public void BecomeControlled() { player = FindObjectOfType <Player>(); if (Player.ReduceFear(fearToBeControlled)) { state = StateOfMind.ControlledAlive; StartCoroutine(FollowPlayer()); } }
public void ChangeMood() { Random rnd = new Random(); if (rnd.Next(11) < 7) { Console.WriteLine("Now I will be happy."); state = new HappyState(); } else { Console.WriteLine("Now I will be sad."); state = new SadState(); } }
public Context() { state = new HappyState(); }