Ejemplo n.º 1
0
    public override void doAction(LChatacterInterface character, LChatacterInformationInterface information)
    {
        if (!hasLoaded)
        {
            return;
        }

        role.ResetTransformData();
        for (int i = 0, c0 = objList.Length; i < c0; i++)
        {
            var o0 = objList[i];
            o0.ResetTransformData();
        }

        CmpAnimationPos(curTime, role, character, information);
        SetRolePos(curTime, role, character, information, ref baseGroundPos, beginLocalScale, beginLocalRot, true);
        for (int i1 = 0, c1 = objList.Length; i1 < c1; i1++)
        {
            var contain = objList[i1];
            CmpAnimationPos(curTime, contain, character, information);
        }
        //因为模型不是技能系统负责加载,所以最后一刻才负责绑定。
        if (null == role.gameobject)
        {
            role.gameobject  = character.GetRoleAnimation().gameObject;
            role.roleRenders = character.GetRoleRender();
        }


        //避免调用字典foreach导致每帧产生 GC Allow
        for (int i = 0, c0 = objList.Length; i < c0; i++)
        {
            var contain = objList[i];
            SetObjectPos(curTime, contain, objs, character, information,
                         beginPositon,
                         beginLocalScale,
                         beginLocalRot);
        }

        {
            var contain = role;
            for (int i = 0, c0 = contain.events.Count; i < c0; i++)
            {
                var _e = contain.events[i];
                CmpObjectEvent(curTime, lastTime, _e, contain, character, information, objs, cdState, cdName, skillState);
            }
        }
        for (int ii = 0, c1 = objList.Length; ii < c1; ii++)
        {
            var contain = objList[ii];
            for (int i = 0, c0 = contain.events.Count; i < c0; i++)
            {
                var _e = contain.events[i];
                CmpObjectEvent(curTime, lastTime, _e, contain, character, information, objs, cdState, cdName, skillState);
            }
        }
        //计算物体事件,比如播放动作,声音等。
        for (int i = 0, c0 = skillData.events.Count; i < c0; i++)
        {
            var _e      = skillData.events[i];
            var contain = objs[_e.objId];
        }
        lastTime = curTime;
    }