Exemplo n.º 1
0
    void saveToAssets()
    {
        string path = EditorUtility.SaveFilePanelInProject("select file to save", "buildConfigs.asset", "asset", "yarrr!");

        path = path.Replace(Application.dataPath + "/", "");
        IosBuildList buildList = ScriptableObject.CreateInstance <IosBuildList>();

        buildList.configs = configs;
        AssetDatabase.CreateAsset(buildList, path);
        AssetDatabase.SaveAssets();
    }
Exemplo n.º 2
0
    void readFromAssets()
    {
        string path = EditorUtility.OpenFilePanel("select asset", Application.dataPath, "asset");

        if (path.Contains(Application.dataPath))
        {
            path = path.Replace(Application.dataPath + "/", "Assets/");
            IosBuildList buildList = (IosBuildList)AssetDatabase.LoadAssetAtPath(path, typeof(IosBuildList));
            if (buildList != null)
            {
                configs = buildList.configs;
            }
            else
            {
                Debug.LogError("some problems in asset loading, its null");
            }
        }
        else
        {
            Debug.LogError("file must be within project folder");
        }
    }