Пример #1
0
        private void UnFreezeAnimator(AnimatorControl p_model)
        {
            Animator component = p_model.GetComponent <Animator>();

            if (component != null)
            {
                component.speed = 1f;
            }
        }
Пример #2
0
    public void MonsterCastSpell(ETarget target, TestSpell spell)
    {
        m_LastSpellIsMonster = false;
        m_LastSpell          = spell;
        m_TargetOrWizard     = target;
        FXDescription fxdescription = Helper.ResourcesLoad <FXDescription>(spell.EffectPath, false);

        if (fxdescription == null)
        {
            Debug.LogError("FXDescription not found! at " + spell.EffectPath, this);
            return;
        }
        if (target == ETarget.Party)
        {
            target = (ETarget)UnityEngine.Random.Range(1, 4);
        }
        GameObject gameObject;

        switch (target)
        {
        case ETarget.Member1:
            gameObject = m_Member1;
            break;

        case ETarget.Member2:
            gameObject = m_Member2;
            break;

        case ETarget.Member3:
            gameObject = m_Member3;
            break;

        case ETarget.Member4:
            gameObject = m_Member4;
            break;

        default:
            return;
        }
        Vector3 forward    = m_ActiveMonster.transform.forward;
        Vector3 p_slotLeft = -m_ActiveMonster.transform.right;

        m_ActiveMonsterAnimationHandler.AttackMagic(spell.AnimationNum);
        AnimatorEventHandler component     = m_ActiveMonsterAnimationHandler.GetComponent <AnimatorEventHandler>();
        GameObject           activeMonster = m_ActiveMonster;
        ETargetType          targetType    = spell.TargetType;
        FXArgs p_args;

        if ((targetType & ETargetType.MULTY) == ETargetType.MULTY)
        {
            p_args = new FXArgs(activeMonster, m_PartySlot, activeMonster, m_PartySlot, activeMonster.transform.position, forward, p_slotLeft, m_PartySlot.transform.position, new List <GameObject>
            {
                m_Member1,
                m_Member2,
                m_Member3,
                m_Member4
            });
        }
        else if ((targetType & ETargetType.SINGLE) == ETargetType.SINGLE)
        {
            p_args = new FXArgs(activeMonster, gameObject, activeMonster, gameObject, activeMonster.transform.position, forward, p_slotLeft, m_PartySlot.transform.position, new List <GameObject>
            {
                gameObject
            });
        }
        else if ((targetType & ETargetType.ADJACENT) == ETargetType.ADJACENT)
        {
            p_args = new FXArgs(activeMonster, activeMonster, activeMonster, activeMonster, activeMonster.transform.position, forward, p_slotLeft, m_PartySlot.transform.position, new List <GameObject>
            {
                gameObject
            });
        }
        else
        {
            p_args = new FXArgs(activeMonster, activeMonster, activeMonster, activeMonster, activeMonster.transform.position, forward, p_slotLeft, m_PartySlot.transform.position, new List <GameObject>
            {
                gameObject
            });
        }
        fxdescription = Helper.Instantiate <FXDescription>(fxdescription);
        fxdescription.Configurate(component, p_args);
    }