Skip to main content

MapGeneratorPart

An abstract class in Root.Township, Alta.Caves.PluginParts.

Base asset for one part of a cave generator plugin. It makes a MapGeneratorPartInstance for each plugin run.

Constructors​

MemberWhat it is
protected MapGeneratorPart()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

2 private and internal fields
MemberWhat it is
private Plugin overrideTargetBacking field for OverrideTarget, the plugin the part works on instead of its own plugin. Null means its own.
private int partIdentifierBacking field for PartIdentifier, hashed into the instance's seed. Set from the asset's instance id when negative.

Properties​

MemberWhat it is
Plugin OverrideTarget { get; }Plugin whose layer this part writes to instead of its own plugin. Null means the owning plugin.
int PartIdentifier { get; }Seed value for the part. Generated from the instance ID when missing.

Methods​

MemberWhat it is
abstract IPartInstance GetInstance(PluginInstance plugin)Creates the runtime instance of this part for a plugin instance.
void RegenerateIdentifier()Sets the identifier from the asset's instance ID.
1 private and internal method
MemberWhat it is
private void OnValidate()Editor: gives the part an identifier if it has none.

Used in​

Members of other types that take, return or hold a MapGeneratorPart: