Class ZoneManager
Manager for adding custom Locations and Vegetation.
Inheritance
System.Object
ZoneManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Jotunn.Managers
Assembly: Jotunn.dll
Syntax
public class ZoneManager : IManager
Properties
| Improve this Doc View SourceInstance
The singleton instance of this manager.
Declaration
public static ZoneManager Instance { get; }
Property Value
Type | Description |
---|---|
ZoneManager |
Methods
| Improve this Doc View SourceAddCustomLocation(CustomLocation)
Register a CustomLocation to be added to the ZoneSystem
Declaration
public bool AddCustomLocation(CustomLocation customLocation)
Parameters
Type | Name | Description |
---|---|---|
CustomLocation | customLocation |
Returns
Type | Description |
---|---|
System.Boolean |
AddCustomVegetation(CustomVegetation)
Register a CustomVegetation to be added to the ZoneSystem
Declaration
public bool AddCustomVegetation(CustomVegetation customVegetation)
Parameters
Type | Name | Description |
---|---|---|
CustomVegetation | customVegetation |
Returns
Type | Description |
---|---|
System.Boolean |
AnyBiomeOf(Heightmap.Biome[])
Return a that matches any of the provided Biomes
Declaration
public static Heightmap.Biome AnyBiomeOf(params Heightmap.Biome[] biomes)
Parameters
Type | Name | Description |
---|---|---|
Heightmap.Biome[] | biomes | Biomes that should match |
Returns
Type | Description |
---|---|
Heightmap.Biome |
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 to be added.
Declaration
public CustomLocation CreateClonedLocation(string name, string baseName)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | name of the custom location |
System.String | baseName | name of the existing location to copy |
Returns
Type | Description |
---|---|
CustomLocation |
CreateLocationContainer(GameObject, Boolean)
Create a copy that is disabled, so any Components in instantiated GameObjects will not start their lifecycle
Declaration
public GameObject CreateLocationContainer(GameObject gameObject, bool fixLocationReferences = false)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gameObject | Prefab to copy |
System.Boolean | fixLocationReferences | Replace JVLmock GameObjects with a copy of their real prefab |
Returns
Type | Description |
---|---|
GameObject |
CreateLocationContainer(String)
Create an empty GameObject that is disabled, so any Components in instantiated GameObjects will not start their lifecycle.
Declaration
public GameObject CreateLocationContainer(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the location |
Returns
Type | Description |
---|---|
GameObject |
GetMatchingBiomes(Heightmap.Biome)
Returns a list of all that match
biome
Declaration
public static List<Heightmap.Biome> GetMatchingBiomes(Heightmap.Biome biome)
Parameters
Type | Name | Description |
---|---|---|
Heightmap.Biome | biome |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Heightmap.Biome> |
GetZoneLocation(String)
Get a ZoneLocation by its name.
Search hierarchy:
Search hierarchy:
Declaration
public ZoneSystem.ZoneLocation GetZoneLocation(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the ZoneLocation to search for. |
Returns
Type | Description |
---|---|
ZoneSystem.ZoneLocation | The existing ZoneLocation, or null if none exists with given name |
GetZoneVegetation(String)
Get a ZoneVegetation by its name.
Search hierarchy:
Search hierarchy:
Declaration
public ZoneSystem.ZoneVegetation GetZoneVegetation(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the ZoneVegetation to search for. |
Returns
Type | Description |
---|---|
ZoneSystem.ZoneVegetation | The existing ZoneVegetation, or null if none exists with given name |
Init()
Initialize the manager
Declaration
public void Init()
Events
| Improve this Doc View SourceOnVanillaLocationsAvailable
Event that gets fired after the vanilla locations are in memory and available for cloning or editing.
Your code will execute every time before a new is copied (on every menu start).
If you want to execute just once you will need to unregister from the event after execution.
Declaration
public static event Action OnVanillaLocationsAvailable
Event Type
Type | Description |
---|---|
System.Action |