Loads an asset at path or creates the asset if needed.
- If the file does not exist, creates the asset using the object returned from getInstance parameter.
- If the asset isn't in the database, imports and loads the asset.
- Parameters
-
| path | Path to an asset file. |
| getInstance | Method that returns an object instance. Invoked only if the asset needs to be created. |
- Template Parameters
-
| T | UnityEngine.Object derived type. |
- Returns
- The loaded or created asset.
- See also
- CodeSmileEditor.Asset.File.Load<T>(CodeSmileEditor.Asset.Path)
Definition at line 393 of file Asset.File.cs.
393 : Object
394 {
395 if (path.ExistsInFileSystem == false)
396 return Create(getInstance.Invoke(), path) as T;
397
398 return ImportAndLoad<T>(path);
399 }
References Create(), and ImportAndLoad< T >().