// Use this for initialization void Start() { loadingScreen.Instance.Disapear(); aud = GetComponent <AudioSource>(); playSound("Chaching"); Instance = this; DB = GameManager.Instance.gurdianDataBase; BTNCreator(); XPSlider.maxValue = GameManager.Instance.expNeed(); }
void OnEnable() { itemDataBase = AssetDatabase.LoadAssetAtPath(FullPathName, typeof(GurdianDataBase)) as GurdianDataBase; if (itemDataBase == null) { if (!AssetDatabase.IsValidFolder(@"Assets/" + FolderName)) { AssetDatabase.CreateFolder(@"Assets", FolderName); } itemDataBase = ScriptableObject.CreateInstance <GurdianDataBase>(); AssetDatabase.CreateAsset(itemDataBase, FullPathName); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } }