Show / Hide Table of Contents

Class ZoneManager

Manager for adding custom Locations, Vegetation and Clutter.
Inheritance
object
ZoneManager
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Jotunn.Managers
Assembly: Jotunn.dll
Syntax
public class ZoneManager

Properties

Name Description
Instance The singleton instance of this manager.

Methods

Name Description
AddCustomClutter(CustomClutter) Register a CustomClutter to be added to the ClutterSystem
AddCustomLocation(CustomLocation) Register a CustomLocation to be added to the ZoneSystem
AddCustomVegetation(CustomVegetation) Register a CustomVegetation to be added to the ZoneSystem
AnyBiomeOf(params Biome[]) Return a Heightmap.Biome that matches any of the provided Biomes
CreateClonedLocation(string, string) Create a CustomLocation that is a deep copy of the original.
Changes will not affect the original. The CustomLocation is already registered in the manager.
CreateLocationContainer(AssetBundle, string) Loads and spawns a GameObject from an AssetBundle as a location container.
The copy is disabled, so any Components in instantiated child GameObjects will not start their lifecycle.
Use this if you plan to alter your location prefab in code after importing it.
Don't create a separate container if you won't alter the prefab afterwards as it creates a new instance for the container.
CreateLocationContainer(GameObject) Create a copy that is disabled, so any Components in instantiated child GameObjects will not start their lifecycle.
Use this if you plan to alter your location prefab in code after importing it.
Don't create a separate container if you won't alter the prefab afterwards as it creates a new instance for the container.
CreateLocationContainer(string) Create an empty GameObject that is disabled, so any Components in instantiated GameObjects will not start their lifecycle.
DestroyCustomLocation(string) Destroy a CustomLocation by its name.
Removes the CustomLocation from the manager and from the ZoneSystem if instantiated.
GetClutter(string) Get a Clutter by its name.

Search hierarchy:
  1. Custom Clutter with the exact name
  2. Vanilla Clutter with the exact name from ClutterSystem
GetCustomLocation(string) Get a custom location by name.
GetMatchingBiomes(Biome) Returns a list of all Heightmap.Biome that match biome
GetZoneLocation(string) Get a ZoneLocation by its name.

Search hierarchy:
  1. Custom Location with the exact name
  2. Vanilla Location with the exact name from ZoneSystem
GetZoneVegetation(string) Get a ZoneVegetation by its name.

Search hierarchy:
  1. Custom Vegetation with the exact name
  2. Vanilla Vegetation with the exact name from ZoneSystem
RegisterLocationInZoneSystem(ZoneLocation) Register a single ZoneLocaton in the current ZoneSystem. Also adds the location prefabs to the PrefabManager and ZNetScene if necessary.
No mock references are fixed.
RemoveCustomClutter(string) Remove a CustomClutter from this manager by its name.
Does not remove it from any current ClutterSystem instance.
RemoveCustomLocation(string) Remove a CustomLocation by its name.
Removes the CustomLocation from the manager. Does not remove the location from any current ZoneSystem instance.
RemoveCustomVegetation(string) Remove a CustomVegetation from this manager by its name.
Does not remove it from any current ZoneSystem instance.

Events

Name Description
OnClutterRegistered Event that gets fired after all CustomClutter are registered in the ClutterSystem. Your code will execute every time a new ClutterSystem is available. If you want to execute just once you will need to unregister from the event after execution.
OnLocationsRegistered Event that gets fired after all CustomLocation are registered in the ZoneSystem. Your code will execute every time a new ZoneSystem is available. If you want to execute just once you will need to unregister from the event after execution.
OnVanillaClutterAvailable Event that gets fired after the vanilla clutter is in memory and available obtain. Your code will execute every time a new ClutterSystem is available. If you want to execute just once you will need to unregister from the event after execution.
OnVanillaLocationsAvailable Event that gets fired after the vanilla locations are in memory and available for cloning or editing. Your code will execute every time a new ZoneSystem is available. If you want to execute just once you will need to unregister from the event after execution.
OnVanillaVegetationAvailable Event that gets fired after the vanilla vegetation is in memory and available obtain. Your code will execute every time a new ZoneSystem is available. If you want to execute just once you will need to unregister from the event after execution.
OnVegetationRegistered Event that gets fired after all CustomVegetation are registered in the ZoneSystem. Your code will execute every time a new ZoneSystem is available. If you want to execute just once you will need to unregister from the event after execution.

Extension Methods

PrefabExtension.FixReferences(object)
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾