Пример #1
0
 /// <summary>
 /// Initializes values upon awake
 /// </summary>
 /// <param name="owner"> The sate machine used by the script</param>
 public override void Initialize(StateMachine owner)
 {
     this.owner = (CowSM)owner;
     OwnerPhysics.SetAirResistance(0.95f);
     FollowSprite.SetActive(false);
     PatrolSprite.SetActive(false);
 }
Пример #2
0
 /// <summary>
 /// Changes movement speed and adds the cow to the fair game list.
 /// </summary>
 public override void Enter()
 {
     Debug.Log("Following");
     Stopped       = false;
     AIagent.speed = MovementSpeed;
     isFollowing   = 0;
     FollowSprite.SetActive(true);
     GameComponents.FollowingCowsList.Add(owner.gameObject);
     if (GameComponents.FairGameList.Contains(owner.gameObject) == false)
     {
         GameComponents.FairGameList.Add(owner.gameObject);
     }
 }
Пример #3
0
 /// <summary>
 /// Removes game object from the cow following list.
 /// </summary>
 public override void Exit()
 {
     Called = false;
     FollowSprite.SetActive(false);
     GameComponents.FollowingCowsList.Remove(owner.gameObject);
 }