Beispiel #1
0
        protected override CharacterControlLogic createCharacterControlLogic()
        {
            if (!_g16)
            {
                _m16 = instance.Type.GetMethod("createCharacterControlLogic", 0);
                _g16 = true;
            }

            if (_m16 != null && !_b16)
            {
                _b16 = true;
                CharacterControlLogic re = (CharacterControlLogic)appdomain.Invoke(_m16, instance, null);
                _b16 = false;
                return(re);
            }
            else
            {
                return(base.createCharacterControlLogic());
            }
        }
Beispiel #2
0
    //logics

    /** 注册逻辑体 */
    protected override void registLogics()
    {
        if ((identity = createIdentityLogic()) != null)
        {
            addLogic(identity);
        }
        else
        {
            Ctrl.throwError("不能没有identity");
        }

        if ((pos = createPosLogic()) != null)
        {
            addLogic(pos);
        }

        //战斗单位再加
        if (BaseC.constlist.unit_canFight(_type))
        {
            if ((avatar = createAvatarLogic()) != null)
            {
                addLogic(avatar);
            }

            if ((move = createMoveLogic()) != null)
            {
                addLogic(move);
            }

            if ((fight = createFightLogic()) != null)
            {
                addLogic(fight);
            }

            if ((ai = createAILogic()) != null)
            {
                addLogic(ai);
            }

            if ((aiCommand = createAICommandLogic()) != null)
            {
                addLogic(aiCommand);
            }
        }

        //角色控制逻辑
        if (isHero)
        {
            if ((control = createCharacterControlLogic()) != null)
            {
                addLogic(control);
            }
        }

        //show放下面
        if ((show = createShowLogic()) != null)
        {
            addLogic(show);
        }
        else
        {
            Ctrl.throwError("不能没有show");
        }

        //head最后
        if (BaseC.constlist.unit_needHead(_type))
        {
            if ((head = createHeadLogic()) != null)
            {
                addLogic(head);
            }
        }
    }