package logic import "ecs/proto/pb" func (this *Player) CheckFunctionOpen(funcMod pb.ModId, funcType pb.FuncType, funcId int) bool { var functionOpen = this.manager.tables.FunctionOpen.Find2(int(funcMod), int(funcType), funcId) if functionOpen == nil { return true } var yes = true for i := range functionOpen.UnlockType { switch functionOpen.UnlockType[i] { case 0: continue case 1: if functionOpen.UnlockArgs[i] > 0 { if this.RoleHero.Level < uint32(functionOpen.UnlockArgs[i]) { yes = false } } } } return yes }