Skip to content

ScriptableObjectExtensions

Namespace: SideXP.Core.EditorOnly

public static class ScriptableObjectExtensions

Extension functions for ScriptableObject instances.

Methods

GetScriptPath(ScriptableObject)

public static string GetScriptPath(ScriptableObject obj)

Parameters

  • obj: The ScriptableObject you want to get the script path.

ResetToDefaults(ScriptableObject)

public static void ResetToDefaults(ScriptableObject obj)

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.