Пример #1
0
    /// <summary>
    /// 通过保存数据,创建使用数据
    /// </summary>
    public CharacterUseData createCharacterUseDataBySaveData(CharacterSaveData saveData)
    {
        CharacterUseData data = GameC.factory.createCharacterUseData();

        data.initDefault();

        //1级
        data.level = me.role.getLevel();
        initMUnitUseBySave(data, saveData);
        initCharacterUseBySave(data, saveData);

        return(data);
    }
Пример #2
0
    /// <summary>
    /// 新创建主角
    /// </summary>
    protected void onNewCreateHero(CharacterUseData useData)
    {
        useData.initDefault();

        CharacterConfig cConfig = CharacterConfig.getCharacterConfigByVocationAndSex(me.role.vocation, me.role.getPartData().sex);

        if (cConfig == null)
        {
            Ctrl.errorLog("找不到单角色配置", me.role.vocation, me.role.getPartData().sex);
            return;
        }

        useData.id    = cConfig.id;
        useData.level = me.role.getLevel();

        newCreateUseData(useData);
    }