public void StartFollowing() { _player = DroneVision.GetPlayer(); if (!_isFollowing) // call the movement coroutine if not already following the player { if (isFleet) { isNotified = true; for (int i = 0; i < Fleet.Count; i++) { Fleet[i].isNotified = true; Fleet[i].StartFollowing(); } /* * foreach(var drone in Fleet) * { * if(!drone.isNotified) * { * drone.isNotified = true; * drone.StartFollowing(); * } * * }*/ } droneState = DroneMovementState.Following; _isFollowing = true; StartCoroutine(FollowPlayer()); } }
public void StartFollowing() { player = DroneVision.GetPlayer(); if (!isFollowing) // call the movement coroutine if not already following the player { droneState = DroneMovementState.Following; isFollowing = true; StartCoroutine(FollowPlayer()); } }