Ejemplo n.º 1
0
        protected override UnitPosLogic createPosLogic()
        {
            if (!_g8)
            {
                _m8 = instance.Type.GetMethod("createPosLogic", 0);
                _g8 = true;
            }

            if (_m8 != null && !_b8)
            {
                _b8 = true;
                UnitPosLogic re = (UnitPosLogic)appdomain.Invoke(_m8, instance, null);
                _b8 = false;
                return(re);
            }
            else
            {
                return(base.createPosLogic());
            }
        }
Ejemplo n.º 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);
            }
        }
    }