コード例 #1
0
 void CreateDatabase()
 {
     m_gameWidgets = ScriptableObject.CreateInstance <WidgetDatabase>();
     AssetDatabase.CreateAsset(m_gameWidgets, DATABASE_PATH);
     AssetDatabase.SaveAssets();
     AssetDatabase.Refresh();
 }
コード例 #2
0
    void LoadDatabase()
    {
        m_gameWidgets = (WidgetDatabase)AssetDatabase.LoadAssetAtPath(DATABASE_PATH, typeof(WidgetDatabase));

        if (m_gameWidgets == null)
        {
            CreateDatabase();
        }
    }
コード例 #3
0
 private void OnEnable()
 {
     Target = target as WidgetDatabase;
 }