Click or drag to resize

ModdableContent Class

A ModdableContent component can be attached to a scene game object or a prefab and allows a single component to be moddable be swapping its source asset(s) with equivilent modded content. Modders are able to create new asset content in their mods such as materials, textures and more. These assets can then be placed in specific folders with specific names relating to the target game object/prefab that they intend to modify. The target folder and asset name is dictated by the NamingSettings naming scheme which is auto generated when moddable content components are added to the scene. The developer will have the option to modify the naming scheme via the UMod Settings window.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          UMod.ModdableModdableContent

Namespace:  UMod.Moddable
Assembly:  UMod (in UMod.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class ModdableContent : MonoBehaviour

The ModdableContent type exposes the following members.

Constructors
  NameDescription
Public methodModdableContent
Initializes a new instance of the ModdableContent class
Top
Properties
  NameDescription
Public propertyAllowAssetIndexing
Return a value indicating whether asset indexing is allowed for this component based on moddableSettings value. When in editor mode (Not playing), this property will always return the value of allowAssetIndexing.
Public propertyConflictBehaviour
Return the conflict behaviour for this component based on moddableSettings value. When in editor mode (Not playing), this property will always return the value of conflictBehaviour.
Public propertyNamingSchemeOverride
Public propertyObjectReference
The ModdableObjectReference that uniquley identifies the parent gamne object in the moddable naming scheme.
Public propertyRevertContentOnDestroy
Return a value indicating whether modded content should be reverted to default for this component when it is destroyed base on moddableSettings value. When in editor mode (Not playing), this property will always return the value of revertContentOnDestroy.
Public propertyUnloadBehaviour
Return the unload behaviour for this component based on moddableSettings value. When in editor mode (Not playing), this proeprty will always return the value of unloadBehaviour.
Top
Methods
  NameDescription
Public methodAddToNamingScheme
Public methodApplyModdableContent
Attempt to apply moddable content from any loaded mods with matching mod content. Conflicts will be handled based on the ConflictBehaviour value.
Public methodApplyModdableContent(ModHost)
Attempt to apply moddable content from the specified loaded mods wtih matching content. All mod hosts passed to this method should have a valid mod loaded otherwise they will be ignored. Conflicts will be handled based on the ConflictBehaviour value.
Public methodAwake
Called by Unity.
Public methodGetAllAppliedContent
Return an array of all applied moddable content.
Public methodGetAppliedContent
Return the first applied moddable content for the target component or null if no moddable content has been applied.
Public methodGetAppliedContentWithIndex
Public methodGetInitialComponentContent
Attempt to get the original initial game asset that was assigned to the target component on startup at the specified array index. Use '-1' when the target component does not support more than one asset or to get the default asset for the component.
Public methodStatic memberGetOrCreateModdableReferenceForObject
Get or create a unique ModdableObjectReference that identifies the specified game object in the moddable asset naming scheme.
Public methodOnDestroy
Called by Unity.
Public methodOnModLoaded
Called when a new mod has been loaded by uMod.
Public methodOnModWillUnload
Called when then owning mod host is about to be unloaded.
Public methodOnValidate
Called by Unity editor.
Protected methodOnWillReplaceContent
Called when the target component will have its asset content modded.
Protected methodOnWillRevertContent
Called when the target component will have its asset reverted to default.
Public methodRemoveFromNamingScheme
Public methodReset
Called by Unity editor.
Public methodRevertModdableContent
Attempt to revert any applied moddable content to use the original game assets.
Public methodStart
Called by Unity.
Top
Fields
  NameDescription
Public fieldallowAssetIndexing
When enabled, mod assets can append array indexing syntax '[...]' to the end of thier file names in order to indicate that a certain asset should be assigned to the specified index. This can be useful for material and texture assets where more that one asset could be assinged to a single object.
Public fieldassetType
The ModdableContentModdableAssetType that can be modified on the target component. This asset type must match the componentes accepted asset type. For example: A mesh filter component could accept a Mesh asset.
Public fieldautoApplyContent
When enabled, the moddable content will automatically be applied when the scene is loaded or when a new mod is loaded.
Public fieldconflictBehaviour
The ModdableContentModdableConflictBehaviour that should occur when one or more mods with the same target moddable content are loaded.
Public fieldloadContentAsync
When enabled, all content loading will be performed asynchronously to prevent blocking the main thread.
Public fieldmoddableSettings
Detemrines whether this component will use the global settings for moddable behaviour of use custom settings as defined on the component.
Public fieldrevertContentOnDestroy
When enabled, any moddable content that was applied via this component will be reverted to the original asset when the component is destroyed.
Public fieldtargetModdableComponent
The target component that can be modified. The specified component must be compatible with the target asset type.
Public fieldunloadBehaviour
Top
See Also