Ejemplo n.º 1
0
    public void fightAnimationComplete()                           //this function is called from battleAnimationUnit2Script and indicates that the defender animation has completed
    {
        unit2Anim.Play("New State");                               //set defender's animation to idle

        cameraRef.backgroundColor = new Color32(147, 179, 128, 0); //after fight animation is complete, change background colour back to green (to match grass)

        this.gameObject.SetActive(false);                          //stop displaying this battle animation scene

        gameMap.SetActive(true);                                   //display the game map

        attackerUnitScript.killIfDead();                           //check if either unit is dead, if so delete that unit from the game
        defenderUnitScript.killIfDead();
    }