예제 #1
0
    private IEnumerator LoadSkillData(CharactorLoadResultData res, string skillId)
    {
        //G:\utils\Tools\SkillEditor\Assets\StreamingAssets\SkillEditor\Data
        string path   = LAssetBundleManager.Instance().GetRootUrl() + "SkillEditor/Data/" + skillId + ".skill";
        var    handle = LAssetBundleManager.Instance().loadAsset(path);

        while (!handle.isFinish)
        {
            yield return(null);
        }
        string txt       = (string)handle.asset;
        var    skillData = JSonHelper.DeserializeSkill(txt);

        skillDatas[skillId] = skillData;
        res.asset           = skillData;
        res.isFinish        = true;
    }
예제 #2
0
    public LCHSkillData GetSkill(string skillId)
    {
        if (skills.ContainsKey(skillId))
        {
            return(skills[skillId]);
        }
#if UNITY_EDITOR
        if (EditorModel && null == loader)
        {
            loader = new EditorFileLoader();
        }
#endif
        var js = loader.LoadFile(skillId, SkillDataType.SKILL);
        if (js.Length == 0)
        {
            return(null);
        }
        var v = JSonHelper.DeserializeSkill(js);
        skills[skillId] = v;
        return(v);
    }