DecalCreator.CreateDecalMesh (Frameshift.Decal.DecalType, UnityEngine.Vector3, UnityEngine.Vector3, UnityEngine.Collider(), UnityEngine.Vector3) Method

DecalFramework

DropDown image DropDownHover image Collapse image Expand image CollapseAll image ExpandAll image Copy image CopyHover image

Create Decal mesh from colliders array. Set directly orientation.

Namespace: Frameshift.Decal
Assembly: Frameshift.Decal (in Frameshift.Decal.dll)

Expand  imageSyntax

C#
public static Mesh CreateDecalMesh( 
DecalType decalType
Vector3 point
Vector3 forward
Collider[] colliders
Vector3 decalWoldUpVector 
);

Parameters

decalType

Type of Decal that will be created.

point

Point in world space where Decal will be calculated.

forward

Direction of decal. Usually -hit.normal.

colliders

Array colliders for which are trying to create decal.

decalWoldUpVector

Decal world up vector, i.e. where top of decal mesh will be look.

Return Value

Decal mesh in world space.

Expand image Example

 CopyCode imageCopy Code
//Find colliders near raycast hit point 
Collider[] colliders=Physics.OverlapSphere(hit.position, 0.3F); 
//Burn decal mesh with vertical orientation 
Mesh decalMesh = DecalCreator.CreateDecalMesh(i_decalType,hit.position,hit.direction, colliders, Vector3.up); 
//Create decal object 
DecalCreator.CreateDynamicDecal(decalMesh, hit.collider, i_decalType);

Expand image Platforms

Unity 2.6.1

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

Expand image See Also