Esempio n. 1
0
    private void StartAct_CastSpell()
    {
        string[]           an        = null;
        CharacterAudioType audioType = CharacterAudioType.None;

        if (_currentAction.spellInfo.isCritical && _anims_CriticalAttack != null && _anims_CriticalAttack.Length > 0)
        {
            audioType = CharacterAudioType.spell_Crit;
        }

        switch (_currentAction.spellInfo.spellType)
        {
        case SpellType.Chakra:
            an        = _anims_Spell_Chakra;
            audioType = CharacterAudioType.chakra;
            break;

        case SpellType.Magic:
            an = FindProperAnimForMagic();
            break;

        case SpellType.Secret:
            an        = _anims_Spell_SecretReveal;
            audioType = CharacterAudioType.secret;
            break;
        }

        PlayAnim(an);

        if (audioType == CharacterAudioType.None)
        {
            _audioManager.PlayCharSpell(moniker, _currentAction.spellInfo.charSpellsIndex);
        }
        else
        {
            _audioManager.PlayChar(moniker, audioType);
        }

        _isSpellHappened             = false;
        _curAnimTrackEntry.Complete += OnSpellCastAnimFinish;
        _curAnimTrackEntry.Event    += OnSpineEventCapture;

        if (_charSpellEffect != null)
        {
            _charSpellEffect.HandleSpellEvent(_curAnimTrackEntry, _currentAction.spellInfo);
        }
    }