Ejemplo n.º 1
0
    public void OnUpdateEvent(AnimationEventControler _eventControler, AnimationState _animState)
    {
        if (_CurAnimNameForEventList.Count <= 0)
        {
            return;
        }

        for (int i = 0; i < _CurAnimNameForEventList.Count; ++i)
        {
            if (!_animState.name.Equals(_CurAnimNameForEventList[i].m_AnimName))
            {
                continue;
            }

            if (_animState.time >= _CurAnimNameForEventList[i].m_HitTime || _animState.enabled == false)
            {
                _eventControler.CallBack_EventFunction(_CurAnimNameForEventList[i].m_FunctionName, _CurAnimNameForEventList[i].m_Param);

                if (_CurAnimNameForEventList.Count <= 0)
                {
                    return;
                }

                _CurAnimNameForEventList.RemoveAt(i);
                break;
            }
        }
    }
Ejemplo n.º 2
0
    // 第一步初始化数据 [1/19/2015 Zmy]
    protected override void InitData()
    {
        _anim  = gameObject.GetComponent <Animation>();
        _event = gameObject.AddComponent <AnimationEventControler>();

        walk_anim   = "Walk1";
        run_anim    = "Run1";
        jump_anim   = "Jump1";
        pose_anim   = "Pose1";
        alarm_anim  = "Alarm1";
        dizzy_anim  = "Dizzy1";
        pick_anim   = "Pick1";
        Nidle1_anim = "Nidle1";
        Nidle2_anim = "Nidle2";
        summon_anim = "Summon1";
        Fidle1_anim = "Fidle1";
        Fidle2_anim = "Fidle0";
        die_anim    = "Die1";
        hurt1_anim  = "Hurt1";
        hurt2_anim  = "Hurt2";
        for (int i = 1; i <= 3; i++)
        {
            attack_anim[i - 1] = "Attack" + i;
        }
        for (int i = 1; i <= 2; i++)
        {
            skill_anim[i - 1] = "Skill" + i;
        }
        lastAnimatimName = walk_anim;
    }
Ejemplo n.º 3
0
    public void HandleRemindEvents(AnimationEventControler eventControler)
    {
        if (_CurAnimNameForEventList != null && _CurAnimNameForEventList.Count > 0)
        {
            _CurAnimNameForEventList.Sort(SortAsTimeLength);

            for (int i = 0; i < _CurAnimNameForEventList.Count; i++)
            {
                eventControler.CallBack_EventFunction(_CurAnimNameForEventList[i].m_FunctionName, _CurAnimNameForEventList[i].m_Param);
            }
        }
    }