public override IEnumerator Update() { //find new spot to mine Debug.Log("PatrolStateExplorer::Update()"); if (ExplorerManager.explorer.HasSpot()) { //ExplorerManager.explorer.SpotDetection(false); ExplorerManager.explorer.ResetSpot(); ExplorerManager.SetState(new MarkingState(ExplorerManager)); } else { Vector3 destination = PathfindingManager.Instance.GetRandomPathNodePos(); ExplorerManager.explorer.SetDestination(destination); } /*if (ExplorerManager.explorer.HasArrived()) * { * Vector3 destination = PathfindingManager.Instance.GetRandomPathNodePos(); * ExplorerManager.explorer.SetDestination(destination); * }*/ return(base.Update()); }
public override IEnumerator Update() { t.Update(Time.deltaTime); if (!t.IsRunning) { ExplorerManager.SetState(new ExplorerNS.PatrolState(ExplorerManager)); } return(base.Update()); }
public override IEnumerator Start() { //explorer.MoveTo(spot) //ExplorerManager.explorer.StopMoving(); Vector3 destination = ExplorerManager.explorer.lastSpot.transform.position; // ExplorerManager.explorer.SetDestination(destination); Spawner.Instance.ResetSpot(ExplorerManager.explorer.lastSpot); Spawner.Instance.CreateMine(destination); ExplorerManager.SetState(new ExplorerNS.PatrolState(ExplorerManager)); return(base.Start()); }