Chunks
Moddable voxel sandbox for room-scale VR.
|
Base class for types that can be loaded from a plugin as a resource. More...
Public Member Functions | |
override string | ToString () |
Returns the fully qualified name of this resource. More... | |
Public Attributes | |
bool | IsValid => Plugin == null || Plugin.IsLoaded |
Protected Member Functions | |
PluginResource () | |
void | AssertIsValid () |
virtual void | OnInitialize () |
virtual void | OnReadDefinition (JToken token, string directory) |
When overridden in an inheriting class, handles reading information about the resource from a json token. Base implementation populates any properties decorated with a JsonPropertyAttribute. More... | |
ResourceName | GetResourceName (JToken token) |
Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition. More... | |
ResourceName | GetResourceName (JToken token, ResourceName @default) |
Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition. If the token is null, default is used. More... | |
Properties | |
Plugin | Plugin [get] |
Plugin this resource was loaded from. More... | |
ResourceName | Name [get] |
Name of this resource. More... | |
Base class for types that can be loaded from a plugin as a resource.
|
protected |
|
protected |
|
protected |
Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition.
token | Token to convert to a resource name |
|
protected |
Converts a json token to a resource name, associating it with the current namespace. Only valid from within OnReadDefinition. If the token is null, default is used.
token | Token to convert to a resource name |
default | Resource name to use if the token is null |
|
protectedvirtual |
|
protectedvirtual |
When overridden in an inheriting class, handles reading information about the resource from a json token. Base implementation populates any properties decorated with a JsonPropertyAttribute.
token | Token to load the resource from |
directory | Location of the loaded json file's parent directory |
Reimplemented in Chunks.Graphics.Texture, Chunks.Geometry.Block, Chunks.Geometry.Surface, Chunks.Audio.SoundEffect, and Chunks.Graphics.Model.
override string Chunks.Plugins.PluginResource.ToString | ( | ) |
Returns the fully qualified name of this resource.
bool Chunks.Plugins.PluginResource.IsValid => Plugin == null || Plugin.IsLoaded |
|
get |
Name of this resource.