Beispiel #1
0
    void Update()
    {
        /*
         * if (counter == 6000)
         * {
         *  spell.iceSpell();
         * }
         * else
         * {
         ++counter;
         * }*/

        if (spell != null && Time.time >= nextDamageEvent)
        {
            nextDamageEvent = Time.time + attackDelay;

            //attack here
            switch (attackPhase)
            {
            case 0:
                UnityEngine.Debug.Log("Attack phase 0");
                anim.Play("IceAttack");
                spell.iceSpell();
                attackPhase = 1;
                break;

            case 1:
                UnityEngine.Debug.Log("Attack phase 1");
                anim.Play("Slimeball");
                spell.fireBallSpell();
                attackPhase = 2;
                break;

            case 2:
                UnityEngine.Debug.Log("Attack phase 2");
                //Summon animation and sound here
                spell.summonSpell();
                attackPhase = 0;
                break;

            default:
                UnityEngine.Debug.Log("Something went wrong");
                attackPhase = 0;
                break;
            }
        }
    }