File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Packages/Ink/Editor/Core/Ink Library Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -80,19 +80,19 @@ IEnumerator IEnumerable.GetEnumerator() {
80
80
81
81
// This occurs on recompile, creation and load (note that data has not been loaded at this point!)
82
82
protected InkLibrary ( ) {
83
- Debug . Log ( "CONSTRUCT " + GetInstanceID ( ) ) ;
84
83
if ( created )
85
84
Debug . LogError ( ( object ) "ScriptableSingleton already exists. Did you query the singleton in a constructor?" ) ;
86
85
else {
87
86
Instance = this ;
88
- // Note that if this constructor is called as load occurs this will not be able to populate the dictionary.
89
- BuildLookupDictionary ( ) ;
90
87
}
91
88
}
92
89
93
- public static void LoadOrCreateInstance ( ) {
94
- var inkLibraryJSON = EditorPrefs . GetString ( "InkLibrary" ) ;
90
+ // After recompile, the data associated with the object is fetched (or whatever happens to it) by this point.
91
+ void OnEnable ( ) {
92
+ BuildLookupDictionary ( ) ;
93
+ }
95
94
95
+ public static void LoadOrCreateInstance ( ) {
96
96
InternalEditorUtility . LoadSerializedFileAndForget ( absoluteSavePath ) ;
97
97
if ( created ) {
98
98
BuildLookupDictionary ( ) ;
@@ -103,7 +103,6 @@ public static void LoadOrCreateInstance () {
103
103
Instance . hideFlags = HideFlags . HideAndDontSave ;
104
104
Rebuild ( ) ;
105
105
SaveToFile ( ) ;
106
-
107
106
}
108
107
}
109
108
You can’t perform that action at this time.
0 commit comments