void CreateDatabase() { m_gameWidgets = ScriptableObject.CreateInstance <WidgetDatabase>(); AssetDatabase.CreateAsset(m_gameWidgets, DATABASE_PATH); AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); }
void LoadDatabase() { m_gameWidgets = (WidgetDatabase)AssetDatabase.LoadAssetAtPath(DATABASE_PATH, typeof(WidgetDatabase)); if (m_gameWidgets == null) { CreateDatabase(); } }
private void OnEnable() { Target = target as WidgetDatabase; }