Ejemplo n.º 1
0
 private static void CreateNewSto(List <ProjectConfigInfo> stos)
 {
     if (stos.Count > 0)
     {
         stos.ReverseForEach((sto) => { AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(sto)); });
     }
     info = ScriptableObj.Create <ProjectConfigInfo>(ProjectConfigInfoPath);
 }
Ejemplo n.º 2
0
        private static void LoadProjectInfo()
        {
            string[] guids = AssetDatabase.FindAssets(string.Format("t:{0}", typeof(ProjectConfigInfo)), new string[] { @"Assets" });
            List <ProjectConfigInfo> stos = guids.ToList()
                                            .ConvertAll((guid) => { return(AssetDatabase.LoadAssetAtPath <ProjectConfigInfo>(AssetDatabase.GUIDToAssetPath(guid))); });

            if (stos.Count == 0 || !AssetDatabase.GetAssetPath(stos[0]).Equals(ProjectConfigInfoPath))
            {
                CreateNewSto(stos);
            }
            else
            {
                for (int i = 1; i < stos.Count; i++)
                {
                    AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(stos[i]));
                }
                info = stos[0];
            }
        }