Пример #1
0
 public void BecomeControlled()
 {
     player = FindObjectOfType <Player>();
     if (Player.ReduceFear(fearToBeControlled))
     {
         state = StateOfMind.ControlledAlive;
         StartCoroutine(FollowPlayer());
     }
 }
Пример #2
0
        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();
            }
        }
Пример #3
0
 public Context()
 {
     state = new HappyState();
 }