예제 #1
0
        internal static BBI_Settings GetInstance(bool ensureAssetGetsCreated)
        {
            if (!s_instance)
            {
                s_instance = FindInstance();
                if (s_instance)
                {
                    s_instanceIsAnAsset = true;
                }
                else
                {
                    s_instanceIsAnAsset = false;
                    s_instance          = ScriptableObject.CreateInstance <BBI_Settings>();
                }
            }

            if (ensureAssetGetsCreated)
            {
                if (!s_instanceIsAnAsset)
                {
                    if (!System.IO.Directory.Exists(BuildInfoPaths.Base))
                    {
                        System.IO.Directory.CreateDirectory(BuildInfoPaths.Base);
                        AssetDatabase.Refresh();
                    }

                    AssetDatabase.CreateAsset(s_instance, BuildInfoPaths.Settings);
                    AssetDatabase.SaveAssets();
                    s_instanceIsAnAsset = true;
                }
            }

            return(s_instance);
        }
예제 #2
0
 public static void EnsureAsset()
 {
     BBI_Settings.GetInstance(true);
 }