public void RunSafeCellQuery(bool avoid_light) { MinionPathFinderAbilities minionPathFinderAbilities = (MinionPathFinderAbilities)navigator.GetCurrentAbilities(); minionPathFinderAbilities.SetIdleNavMaskEnabled(true); SafeCellQuery safeCellQuery = PathFinderQueries.safeCellQuery.Reset(brain, avoid_light); navigator.RunQuery(safeCellQuery); minionPathFinderAbilities.SetIdleNavMaskEnabled(false); cell = safeCellQuery.GetResultCell(); if (cell == Grid.PosToCell(navigator)) { cell = Grid.InvalidCell; } }
public override void Update() { if (!prefabid.HasTag(GameTags.Idle)) { cell = Grid.InvalidCell; } else { MinionPathFinderAbilities minionPathFinderAbilities = (MinionPathFinderAbilities)navigator.GetCurrentAbilities(); minionPathFinderAbilities.SetIdleNavMaskEnabled(true); IdleCellQuery idleCellQuery = PathFinderQueries.idleCellQuery.Reset(brain, Random.Range(30, 60)); navigator.RunQuery(idleCellQuery); minionPathFinderAbilities.SetIdleNavMaskEnabled(false); cell = idleCellQuery.GetResultCell(); } }