/// <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); }
/// <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); } }
/// <summary> /// Removes game object from the cow following list. /// </summary> public override void Exit() { Called = false; FollowSprite.SetActive(false); GameComponents.FollowingCowsList.Remove(owner.gameObject); }