Ejemplo n.º 1
0
    /// <summary>
    /// 通过保存数据初始化
    /// </summary>
    public void initCharacterUseLogicBySaveData(CharacterUseLogic logic, CharacterSaveData saveData, bool needFuncTool, bool needBindPlayer, bool isClientDrive)
    {
        CharacterUseData useData = createCharacterUseDataBySaveData(saveData);

        initUseLogicByUseData(logic, useData, needFuncTool, needBindPlayer, isClientDrive);

        if (saveData.cache != null)
        {
            logic.getFightLogic().loadCache(saveData.cache);
        }
    }
Ejemplo n.º 2
0
        public override CharacterUseLogic getCurrentCharacterUseLogic()
        {
            if (!_g20)
            {
                _m20 = instance.Type.GetMethod("getCurrentCharacterUseLogic", 0);
                _g20 = true;
            }

            if (_m20 != null && !_b20)
            {
                _b20 = true;
                CharacterUseLogic re = (CharacterUseLogic)appdomain.Invoke(_m20, instance, null);
                _b20 = false;
                return(re);
            }
            else
            {
                return(base.getCurrentCharacterUseLogic());
            }
        }
Ejemplo n.º 3
0
    public void makeCharacterData(UnitData data)
    {
        if (!enabled)
        {
            return;
        }

        if (_scene.isDriveAll() && _config.isIndependent)
        {
            CharacterUseLogic logic = _scene.inout.getCharacterLogic(data.identity.playerID);

            //自己的才做
            if (logic.isSelf())
            {
                logic.cacheForTown();

                //清空
                logic.getFightLogic().clearDataForIndependent();
            }
        }
    }
Ejemplo n.º 4
0
    public override void preRemove()
    {
        base.preRemove();

        if (_scene.isDriveAll())
        {
            if (_scene.hero != null && !_scene.hero.fight.isAlive())
            {
                _scene.hero.fight.doRevive();
            }

            CharacterUseLogic logic = GameC.player.character.getCurrentCharacterUseLogic();

            if (_config.isIndependent)
            {
                //同一个
                if (logic.getData().id == _scene.hero.getUnitData().getCharacterIdentity().id)
                {
                    //读取缓存
                    logic.loadTownCache();
                }
            }
        }
    }
Ejemplo n.º 5
0
    /// <summary>
    /// 构造函数(只在new后调用一次,再次从池中取出不会调用)
    /// </summary>
    public override void construct()
    {
        base.construct();

        _hero = GameC.factory.createCharacterUseLogic();
    }