Example #1
0
    public void CreateRole(params object[] arg)
    {
        string      id   = (string)arg[0];
        int         type = (int)arg[1];
        LCHRoleData r    = new LCHRoleData();

        r.id = id;
        string json = JsonConvert.SerializeObject(r);

#if UNITY_EDITOR
        if (EditorModel && null == loader)
        {
            loader = new EditorFileLoader();
        }
        if (loader.Exists(id, SkillDataType.ROLE))
        {
            EditorUtility.DisplayDialog("提示", "同id角色已经存", "确定");
            return;
        }
#endif
        loader.SaveFile(id, json, SkillDataType.ROLE);
    }