Class CGModule
- Namespace
- FluffyUnderware.Curvy.Generator
Curvy Generator module base class
[ExecuteAlways]
public abstract class CGModule : DTVersionedMonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourDTVersionedMonoBehaviourCGModule
- Derived
Constructors
CGModule()
public CGModule()
Fields
InputLinks
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
- See Also
OutputLinks
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
- See Also
Properties
[HideInInspector]
public CGModuleProperties Properties
Field Value
UIMessages
[NonSerialized]
public List<string> UIMessages
Field Value
Properties
Active
public bool Active { get; set; }
Property Value
Dirty
public bool Dirty { get; set; }
Property Value
Generator
public CurvyGenerator Generator { get; }
Property Value
Input
The input slots of the module
[NotNull]
public List<CGModuleInputSlot> Input { get; }
Property Value
InputByName
Input slots mapped by their slot name
[NotNull]
public Dictionary<string, CGModuleInputSlot> InputByName { get; }
Property Value
- 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
IsInitialized
Gets whether the module and all its dependencies are fully initialized
public virtual bool IsInitialized { get; }
Property Value
ModuleName
public string ModuleName { get; set; }
Property Value
OnBeforeRefresh
public CurvyCGEvent OnBeforeRefresh { get; set; }
Property Value
OnRefresh
public CurvyCGEvent OnRefresh { get; set; }
Property Value
Output
The output slots of the module
[NotNull]
public List<CGModuleOutputSlot> Output { get; }
Property Value
OutputByName
Output slots mapped by their slot name
[NotNull]
public Dictionary<string, CGModuleOutputSlot> OutputByName { get; }
Property Value
- 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
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
UniqueID
Unique identifier to identify the module in the generator
public int UniqueID { get; set; }
Property Value
Methods
AddManagedResource(string, string, int)
public Component AddManagedResource(string resourceName, string context = "", int index = -1)
Parameters
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
GetAllPrefabPools()
public List<IPool> GetAllPrefabPools()
Returns
- List<IPool>
GetInputLink(CGModuleInputSlot, CGModuleOutputSlot)
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
inputSlotCGModuleInputSlotoutputSlotCGModuleOutputSlot
Returns
GetInputLinks(CGModuleInputSlot)
Get all the links between this module's inputSlot and other modules' outputSlots
[NotNull]
public List<CGModuleLink> GetInputLinks(CGModuleInputSlot inputSlot)
Parameters
inputSlotCGModuleInputSlot
Returns
GetInputSlot(string)
public CGModuleInputSlot GetInputSlot(string name)
Parameters
namestring
Returns
GetManagedResources(out List<Component>, out List<string>)
public bool GetManagedResources(out List<Component> components, out List<string> resourceNames)
Parameters
Returns
GetOutputLink(CGModuleOutputSlot, CGModuleInputSlot)
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
outputSlotCGModuleOutputSlotinputSlotCGModuleInputSlot
Returns
GetOutputLinks(CGModuleOutputSlot)
Get all the links between this module's outputSlot and other modules' inputSlots
[NotNull]
public List<CGModuleLink> GetOutputLinks(CGModuleOutputSlot outputSlot)
Parameters
outputSlotCGModuleOutputSlot
Returns
GetOutputSlot(string)
public CGModuleOutputSlot GetOutputSlot(string name)
Parameters
namestring
Returns
GetRequestParameter<T>(ref CGDataRequestParameter[])
Gets a request parameter of a certain type
protected static T GetRequestParameter<T>(ref CGDataRequestParameter[] requests) where T : CGDataRequestParameter
Parameters
requestsCGDataRequestParameter[]reference to the list of request parameters
Returns
- T
the wanted request parameter or null
Type Parameters
TType derived from PCGDataRequestParameter
Initialize()
public void Initialize()
IsManagedResource(Component)
public bool IsManagedResource(Component res)
Parameters
resComponent
Returns
OnBeforeRefreshEvent(CurvyCGEventArgs)
protected CurvyCGEventArgs OnBeforeRefreshEvent(CurvyCGEventArgs e)
Parameters
Returns
OnRefreshEvent(CurvyCGEventArgs)
protected CurvyCGEventArgs OnRefreshEvent(CurvyCGEventArgs e)
Parameters
Returns
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
requestsCGDataRequestParameter[]reference to the requests array
requestCGDataRequestParameterthe request to remove