Class WorldObjectTitleAddon
- Namespace
- Nautilus.Handlers.TitleScreen
- Assembly
- Nautilus.dll
Enables and disables a custom GameObject in the main menu depending on what mod theme is selected.
public class WorldObjectTitleAddon : TitleAddon, IManagedUpdateBehaviour, IManagedBehaviour
- Inheritance
-
WorldObjectTitleAddon
- Implements
-
IManagedUpdateBehaviourIManagedBehaviour
- Inherited Members
- Extension Methods
Constructors
WorldObjectTitleAddon(Func<GameObject>, float, params string[])
Spawns in the specified UnityEngine.GameObject when your mod is selected.
public WorldObjectTitleAddon(Func<GameObject> spawnObject, float fadeInTime = 1, params string[] requiredGUIDs)
Parameters
spawnObject
Func<GameObject>- A function to get the object to enable. It is recommended to spawn your object in this method to ensure returning to the main menu from a save does not cause NREs.
fadeInTime
float- The duration of the fade in for enabling/disabling objects. The spawnObject must have SN shaders applied for this to work.
requiredGUIDs
string[]- The required mod GUIDs for this addon to enable. Each required mod must approve this addon by using ApproveTitleCollaboration(BaseUnityPlugin, CollaborationData).
Fields
FadeInTime
The duration that it takes for an object to fade in when enabled/disabled.
protected readonly float FadeInTime
Field Value
SpawnObject
The func to spawn the world object. Set in the constructor.
protected readonly Func<GameObject> SpawnObject
Field Value
- Func<GameObject>
WorldObject
The object that is spawned in the world and managed.
protected GameObject WorldObject
Field Value
- GameObject
Methods
ManagedUpdate()
Called every frame while registered.
public virtual void ManagedUpdate()
OnDisable()
Disables the managed object.
protected override void OnDisable()
OnEnable()
Enables the managed object.
protected override void OnEnable()
OnInitialize()
Sets the correct sky appliers on the managed object.
protected override void OnInitialize()