Table of Contents

Class CGModule

Curvy Generator module base class

[ExecuteAlways]
public abstract class CGModule : DTVersionedMonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
DTVersionedMonoBehaviour
CGModule
Derived

Constructors

CGModule()

public CGModule()

Fields

List of links between this module's input slots and other modules' output slots. Do not manipulate this list directly. To add/remove links, use the link manipulating methods of the slots in Input and Output properties.

[HideInInspector]
public List<CGModuleLink> InputLinks

Field Value

List<CGModuleLink>
See Also

List of links between this module's output slots and other modules' input slots. Do not manipulate this list directly. To add/remove links, use the link manipulating methods of the slots in Input and Output properties.

[HideInInspector]
public List<CGModuleLink> OutputLinks

Field Value

List<CGModuleLink>
See Also

Properties

[HideInInspector]
public CGModuleProperties Properties

Field Value

CGModuleProperties

UIMessages

[NonSerialized]
public List<string> UIMessages

Field Value

List<string>

Properties

Active

public bool Active { get; set; }

Property Value

bool

Dirty

public bool Dirty { get; set; }

Property Value

bool

Generator

public CurvyGenerator Generator { get; }

Property Value

CurvyGenerator

Input

The input slots of the module

[NotNull]
public List<CGModuleInputSlot> Input { get; }

Property Value

List<CGModuleInputSlot>

InputByName

Input slots mapped by their slot name

[NotNull]
public Dictionary<string, CGModuleInputSlot> InputByName { get; }

Property Value

Dictionary<string, CGModuleInputSlot>
See Also

IsConfigured

Gets whether the module is properly configured i.e. has everything to work like intended

public virtual bool IsConfigured { get; }

Property Value

bool

IsInitialized

Gets whether the module and all its dependencies are fully initialized

public virtual bool IsInitialized { get; }

Property Value

bool

ModuleName

public string ModuleName { get; set; }

Property Value

string

OnBeforeRefresh

public CurvyCGEvent OnBeforeRefresh { get; set; }

Property Value

CurvyCGEvent

OnRefresh

public CurvyCGEvent OnRefresh { get; set; }

Property Value

CurvyCGEvent

Output

The output slots of the module

[NotNull]
public List<CGModuleOutputSlot> Output { get; }

Property Value

List<CGModuleOutputSlot>

OutputByName

Output slots mapped by their slot name

[NotNull]
public Dictionary<string, CGModuleOutputSlot> OutputByName { get; }

Property Value

Dictionary<string, CGModuleOutputSlot>
See Also

RandomizeSeed

If is set to false, Seed is used to initialize Unity's random numbers generator before refreshing the current module. If set to true, a random seed will be used

public bool RandomizeSeed { get; set; }

Property Value

bool

Seed

If RandomizeSeed is set to false, Seed is used to initialize Unity's random numbers generator before refreshing the If RandomizeSeed is set to true, a random seed will be used current module

public int Seed { get; set; }

Property Value

int

UniqueID

Unique identifier to identify the module in the generator

public int UniqueID { get; set; }

Property Value

int

Methods

AddManagedResource(string, string, int)

public Component AddManagedResource(string resourceName, string context = "", int index = -1)

Parameters

resourceName string
context string
index int

Returns

Component

Delete()

public void Delete()

DeleteAllOutputManagedResources()

Delete all the managed resources acting as an output. One example of this are the generated meshes by the CreateMesh module

public virtual bool DeleteAllOutputManagedResources()

Returns

bool

True if there were deleted resources

DeleteAllPrefabPools()

public void DeleteAllPrefabPools()

DeleteManagedResource(string, Component, string, bool)

public void DeleteManagedResource(string resourceName, Component res, string context = "", bool dontUsePool = false)

Parameters

resourceName string
res Component
context string
dontUsePool bool

GetAllPrefabPools()

public List<IPool> GetAllPrefabPools()

Returns

List<IPool>

Get the first link, if any, between this module's inputSlot and another module's outputSlot

[CanBeNull]
public CGModuleLink GetInputLink(CGModuleInputSlot inputSlot, CGModuleOutputSlot outputSlot)

Parameters

inputSlot CGModuleInputSlot
outputSlot CGModuleOutputSlot

Returns

CGModuleLink

Get all the links between this module's inputSlot and other modules' outputSlots

[NotNull]
public List<CGModuleLink> GetInputLinks(CGModuleInputSlot inputSlot)

Parameters

inputSlot CGModuleInputSlot

Returns

List<CGModuleLink>

GetInputSlot(string)

public CGModuleInputSlot GetInputSlot(string name)

Parameters

name string

Returns

CGModuleInputSlot

GetManagedResources(out List<Component>, out List<string>)

public bool GetManagedResources(out List<Component> components, out List<string> resourceNames)

Parameters

components List<Component>
resourceNames List<string>

Returns

bool

Get the first link, if any, between this module's outputSlot and another module's inputSlot

[CanBeNull]
public CGModuleLink GetOutputLink(CGModuleOutputSlot outputSlot, CGModuleInputSlot inputSlot)

Parameters

outputSlot CGModuleOutputSlot
inputSlot CGModuleInputSlot

Returns

CGModuleLink

Get all the links between this module's outputSlot and other modules' inputSlots

[NotNull]
public List<CGModuleLink> GetOutputLinks(CGModuleOutputSlot outputSlot)

Parameters

outputSlot CGModuleOutputSlot

Returns

List<CGModuleLink>

GetOutputSlot(string)

public CGModuleOutputSlot GetOutputSlot(string name)

Parameters

name string

Returns

CGModuleOutputSlot

GetRequestParameter<T>(ref CGDataRequestParameter[])

Gets a request parameter of a certain type

protected static T GetRequestParameter<T>(ref CGDataRequestParameter[] requests) where T : CGDataRequestParameter

Parameters

requests CGDataRequestParameter[]

reference to the list of request parameters

Returns

T

the wanted request parameter or null

Type Parameters

T

Type derived from PCGDataRequestParameter

Initialize()

public void Initialize()

IsManagedResource(Component)

public bool IsManagedResource(Component res)

Parameters

res Component

Returns

bool

OnBeforeRefreshEvent(CurvyCGEventArgs)

protected CurvyCGEventArgs OnBeforeRefreshEvent(CurvyCGEventArgs e)

Parameters

e CurvyCGEventArgs

Returns

CurvyCGEventArgs

OnRefreshEvent(CurvyCGEventArgs)

protected CurvyCGEventArgs OnRefreshEvent(CurvyCGEventArgs e)

Parameters

e CurvyCGEventArgs

Returns

CurvyCGEventArgs

OnStateChange()

Called when a module's state changes (Link added/removed, Active toggles etc..)

public virtual void OnStateChange()

OnTemplateCreated()

Called after a module was copied to a template

public virtual void OnTemplateCreated()

Remarks

Use this handle references that can't be templated etc...

Refresh()

Add Module processing code in here

public virtual void Refresh()

RemoveRequestParameter(ref CGDataRequestParameter[], CGDataRequestParameter)

Removes a certain request parameter from the requests array

protected static void RemoveRequestParameter(ref CGDataRequestParameter[] requests, CGDataRequestParameter request)

Parameters

requests CGDataRequestParameter[]

reference to the requests array

request CGDataRequestParameter

the request to remove