Example #1
0
 void Awake()
 {
     gameControl = GetComponent <TurnBasedBattle>();
     // Set up the reference.
     anim        = UICanvas.GetComponent <Animator> ();
     audioSource = GetComponent <AudioSource> ();
 }
        public void Start_WhenFinished_BattleIsOver()
        {
            // Arrange

            // characters will attack for one damage each turn until they die
            var characters = new[]
            {
                CreateCharacter("a"),
                CreateCharacter("b"),
            };

            var battle = new TurnBasedBattle(
                new MoveProcessor(),
                new Mock <IActionHistory>().Object,
                new Mock <IGameOutput>().Object,
                characters);

            // Act
            battle.Start();

            // Assert
            Assert.That(battle.IsOver, Is.True);
        }
Example #3
0
 // Use this for initialization
 void Start()
 {
     playerSpecial = GameObject.Find("PlayerSpecial").GetComponent <PlayerSpecial> ();
     gameControl   = GameObject.Find("GameControl").GetComponent <TurnBasedBattle> ();
 }
Example #4
0
 // Use this for initialization
 void Start()
 {
     gameControl = GameObject.Find("GameControl").GetComponent <TurnBasedBattle>();
     Destroy(gameObject, destroyTime);
 }
Example #5
0
 // Use this for initialization
 void Awake()
 {
     gameControl    = GameObject.Find("GameControl").GetComponent <TurnBasedBattle>();
     spriteRenderer = GetComponent <SpriteRenderer> ();
 }