Class CreateMesh
- Namespace
- FluffyUnderware.Curvy.Generator.Modules
Creates mesh GameObjects from VMesh data
public class CreateMesh : ResourceExportingModule
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourDTVersionedMonoBehaviourCreateMesh
- Inherited Members
Constructors
CreateMesh()
public CreateMesh()
Fields
InSpots
[HideInInspector]
[InputSlotInfo(typeof(CGSpots), Array = true, Name = "Spots", Optional = true)]
public CGModuleInputSlot InSpots
Field Value
InVMeshArray
[HideInInspector]
[InputSlotInfo(typeof(CGVMesh), Array = true, Name = "VMesh")]
public CGModuleInputSlot InVMeshArray
Field Value
Properties
AnchorOverride
public Transform AnchorOverride { get; set; }
Property Value
- Transform
AutoUpdateColliders
public bool AutoUpdateColliders { get; set; }
Property Value
CastShadows
public ShadowCastingMode CastShadows { get; set; }
Property Value
- ShadowCastingMode
Collider
The type of collider to create on the mesh GameObject
public CGColliderEnum Collider { get; set; }
Property Value
Combine
When enabled, combines multiple meshes into a single mesh
public bool Combine { get; set; }
Property Value
Convex
public bool Convex { get; set; }
Property Value
CookingOptions
Options used to enable or disable certain features in Collider mesh cooking. See Unity's MeshCollider.cookingOptions for more details
public MeshColliderCookingOptions CookingOptions { get; set; }
Property Value
- MeshColliderCookingOptions
GroupMeshes
When Combine is true, combine only meshes sharing the same index.
public bool GroupMeshes { get; set; }
Property Value
Remarks
Is used only if InSpots is not empty
IncludeNormals
If true, the generated mesh will have normals
public bool IncludeNormals { get; set; }
Property Value
IncludeTangents
If true, the generated mesh will have tangents
public bool IncludeTangents { get; set; }
Property Value
IsTrigger
Is the created collider a trigger
public bool IsTrigger { get; set; }
Property Value
Layer
The layer assigned to the created mesh GameObject
public int Layer { get; set; }
Property Value
LightProbeUsage
public LightProbeUsage LightProbeUsage { get; set; }
Property Value
- LightProbeUsage
MakeStatic
If enabled, meshes will have the Static flag set, and will not be generated/updated in Play Mode. This is to maintain Unity optimizations done in Edit Mode on static GameObjects.
public bool MakeStatic { get; set; }
Property Value
Remarks
Do not set to true if you rely on Play Mode generated meshes
Material
public PhysicsMaterial Material { get; set; }
Property Value
- PhysicsMaterial
ReceiveShadows
public bool ReceiveShadows { get; set; }
Property Value
ReflectionProbes
public ReflectionProbeUsage ReflectionProbes { get; set; }
Property Value
- ReflectionProbeUsage
RendererEnabled
public bool RendererEnabled { get; set; }
Property Value
Tag
The tag assigned to the created mesh GameObject
public string Tag { get; set; }
Property Value
UnwrapUV2
Warning: this operation is Editor only (not available in builds) and CPU intensive When combining multiple meshes, the UV2s are by default kept as is. Use this option to recompute them by uwrapping the combined mesh.
public bool UnwrapUV2 { get; set; }
Property Value
UseLightProbes
public bool UseLightProbes { get; set; }
Property Value
Methods
DeleteAllOutputManagedResources()
Delete all the managed resources acting as an output. One example of this are the generated meshes by the CreateMesh module
public override bool DeleteAllOutputManagedResources()
Returns
- bool
True if there were deleted resources
OnAfterDeserialize()
Implement this callback to transform data back into runtime data types after an object is deserialized.
public void OnAfterDeserialize()
OnBeforeSerialize()
Implement this callback to transform data into serializable data types immediately before an object is serialized.
public void OnBeforeSerialize()
Refresh()
Add Module processing code in here
public override void Refresh()
SaveResourceToScene(Component, Transform)
Save a specific resource to the scene as a GameObject
protected override GameObject SaveResourceToScene(Component managedResource, Transform newParent)
Parameters
managedResourceComponentnewParentTransform
Returns
- GameObject
The saved GameObject
SaveToAsset()
Saves the created meshes to asset files
public void SaveToAsset()
Remarks
Will open a file selector to select where to save the files
SaveToSceneAndAsset()
Saves a copy of the generated mesh(es) as Asset(s), then creates a GameObject, outside of the generator, referencing those mesh assets. This way the created GameObject can be made part of a prefab without issues
public void SaveToSceneAndAsset()
Remarks
Will open a file selector to select where to save the files
UpdateColliders()
public void UpdateColliders()