ScriptableObjectUtility¶
Namespace:
SideXP.Core.EditorOnly
Miscellaneous functions for working with ScriptableObject and assets in the editor.
Methods¶
GetScriptPath(Type)¶
Gets the path to the source script of the given type of ScriptableObject.
Parameters
scriptableObjectType: The type of theScriptableObjectyou want to get the script file path.
Returns
Returns the found script path, or null if the path to the script file can't be found.
GetScriptPath(ScriptableObject)¶
Gets the path to the source script of the given type of ScriptableObject.
Parameters
obj: TheScriptableObjectyou want to get the script path.
Returns
Returns the found script path, or null if the path to the script file can't be found.
GetScriptPath<TScriptableObject>()¶
Gets the path to the source script of the given type of ScriptableObject.
Type parameters
TScriptableObject: The type of theScriptableObjectyou want to get the script file path.
Returns
Returns the found script path, or null if the path to the script file can't be found.
ResetToDefaults(ScriptableObject)¶
Reset the given object to its default values. This operation is undoable.
Parameters
obj: The object to reset.
Remarks
Since Unity doesn't provide a utility function to do this, this function will create an asset of the same type, and copy its serialized values to the given object.