public void ChangeMode_PursuitAndWander() { ResetModes(); isPursuitMode = true; pursuer = boids[0]; pursuer.ResetSteeringBehaviors(); AssignPursuitTarget(); pursuer.TogglePursuit(true); pursuer.ChangeMaterialHighlight(); pursuer.maxSpeed += 1; for (int i = 1; i < boids.Count; i++) { boids[i].ResetSteeringBehaviors(); boids[i].ToggleWander(true); boids[i].isAvoidingCollision = true; } }
public void ChangeMode_LeaderFollowing() { ResetModes(); isLeaderFollowingMode = true; leaderSeekTimer = timeTillLeaderSeekTargetChange; leaderSeekTarget.gameObject.SetActive(true); leaderSeekTarget.position = cellGrid.GetRandomCell(0).transform.position + new Vector3(0f, 0.5f, 0f); leader = boids[0]; leader.ResetSteeringBehaviors(); leader.isArriving = true; leader.targetTransform = leaderSeekTarget; leader.ChangeMaterialHighlight(); for (int i = 1; i < boids.Count; i++) { boids[i].ResetSteeringBehaviors(); boids[i].isLeaderFollowing = true; boids[i].leader = leader; boids[i].isSeperating = true; } }