DecalCreator.CreateDynamicDecal (UnityEngine.Mesh, UnityEngine.GameObject, Frameshift.Decal.DecalType) Method

DecalFramework

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

Create Decal GameObject.

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

Expand  imageSyntax

C#
public static GameObject CreateDynamicDecal( 
Mesh decalMesh
GameObject obj
DecalType decalType 
);

Parameters

decalMesh

Decal mesh in world space

obj

Parent(Holder) for Decal

decalType

Type of this Decal

Return Value

DecalExpeditor for this decalType on this obj

Expand image Example

 CopyCode imageCopy Code
 
RaycastHit hit; 
Ray ray = Camera.main.ViewportPointToRay(new Vector3(0.5F, 0.5F, 0)); 
bool wasHit = Physics.Raycast(ray, out hit); 
if (wasHit) 

if (hit.collider.gameObject.renderer) 

//Burn decal 
Mesh decalMesh = DecalCreator.CreateDecalMesh(i_decalType, hit.point, 
-hit.normal, hit.collider.gameObject); 
//Create Decal Object 
DecalCreator.CreateDynamicDecal(decalMesh, hit.collider.gameObject, 
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