The LoadResource
method attempts to load an asset as a resource of an automatically determined type. This method is part of the Editor.Asset
class and is used to convert an asset into a usable resource within the Sandbox environment.
The LoadResource
method attempts to load an asset as a resource of an automatically determined type. This method is part of the Editor.Asset
class and is used to convert an asset into a usable resource within the Sandbox environment.
To use the LoadResource
method, you need to have an instance of the Editor.Asset
class. Call the method on this instance to attempt loading the asset as a resource. The method returns a Sandbox.Resource
object if successful.
// Assuming 'asset' is an instance of Editor.Asset Sandbox.Resource resource = asset.LoadResource(); if (resource != null) { // Successfully loaded the resource // Use the resource as needed } else { // Handle the failure to load the resource }