Esempio n. 1
0
    void OnEnable()
    {
        name = "Table Process";
        autoRepaintOnSceneChange = false;

        asset = AssetDatabase.LoadAssetAtPath(EditorHelper.profileFolder + "/" + assetName,
                                              typeof(TableProcessProfile)) as TableProcessProfile;
        if (asset == null)
        {
            Debug.LogError(EditorHelper.profileFolder + "/" + assetName + " no found, please create it first!");
        }

        tables     = new List <SerializedProperty>();
        serialized = new SerializedObject(asset);
        SerializedProperty tableInfos = serialized.FindProperty("tableInfos");

        for (int i = 0; i < tableInfos.arraySize; i++)
        {
            SerializedProperty obj = tableInfos.GetArrayElementAtIndex(i);
            if (obj != null)
            {
                tables.Add(obj);
            }
        }
        SortTestObj2Camparer st = new SortTestObj2Camparer();

        asset.tableInfos.Sort(st);
        if (asm == null)
        {
            asm = Assembly.Load("Assembly-CSharp");
        }
    }
Esempio n. 2
0
 void LoadAsset(string _asset)
 {
     profile = AssetDatabase.LoadAssetAtPath(mStrAssetProfileFolder + _asset, typeof(TableProcessProfile)) as TableProcessProfile;
     if (profile == null)
     {
         Debug.LogError(mStrAssetProfileFolder + "mStrProfileName" + _asset + " no found, please create it first!");
     }
     profile.tableInfos.Sort(new TableProcessComparer());
 }
Esempio n. 3
0
    static void CreateExcelTableAsset()
    {
        TableProcessProfile _profile = AssetDatabase.LoadAssetAtPath(mStrAssetProfileFolder + mStrProfileName,
                                                                     typeof(TableProcessProfile)) as TableProcessProfile;

        if (_profile == null)
        {
            _profile = EditorHelper.CreateNewEditorProfile <TableProcessProfile>("TableProcessProfile_System.asset", mStrAssetProfileFolder, "TableProcessProfile");
        }
    }
Esempio n. 4
0
    void OnEnable() {
        name = "Table Process";
        autoRepaintOnSceneChange = false;

        asset = AssetDatabase.LoadAssetAtPath(EditorHelper.profileFolder + "/" + assetName,
                                              typeof(TableProcessProfile)) as TableProcessProfile;
        if (asset == null) return;

        serialized = new SerializedObject(asset);
        characterExcelProp = serialized.FindProperty("characterExcel");
    }
    void OnEnable()
    {
        name = "Table Process";
        autoRepaintOnSceneChange = false;

        asset = AssetDatabase.LoadAssetAtPath(EditorHelper.profileFolder + "/" + assetName,
                                              typeof(TableProcessProfile)) as TableProcessProfile;
        if (asset == null) {
            Debug.LogError(EditorHelper.profileFolder + "/" + assetName + " no found, please create it first!" );
        }

        tables = new List<SerializedProperty>();
        serialized = new SerializedObject(asset);
        SerializedProperty tableInfos = serialized.FindProperty("tableInfos");
        for (int i = 0; i < tableInfos.arraySize; i++) {
            SerializedProperty obj = tableInfos.GetArrayElementAtIndex(i);
            if (obj != null) {
                tables.Add(obj);
            }
        }

        if (asm == null) {
            asm = Assembly.Load("Assembly-CSharp");
        }
    }