Particle Playground - Script Reference  3.0.1
Framework for controlling particles in the Unity Engine.
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
ParticlePlayground.ParticleStateC Class Reference

Holds information about a State source. More...

Public Member Functions

bool IsInitializing ()
 Determines whether this State is initializing. This is used for multithreading to determine if a State's Initialize() function is being executed. More...
 
void Initialize ()
 Initializes a ParticleState for construction. More...
 
void UpdateMatrix (bool isLocal)
 
void ConstructParticles (Texture2D image, float scale, Vector3 offset, string newStateName, Transform newStateTransform)
 Constructs image data. More...
 
void ConstructParticles (Mesh mesh, Texture2D texture, float scale, Vector3 offset, string newStateName, Transform newStateTransform)
 Constructs Mesh data with texture. More...
 
void ConstructParticles (Mesh mesh, float scale, Vector3 offset, string newStateName, Transform newStateTransform)
 Constructs Mesh data without texture. More...
 
Color32 GetColor (int index)
 Returns color at index of ParticleState. More...
 
Vector3 GetPosition (int index)
 Returns position at index of ParticleState. More...
 
Vector3 GetLocalPosition (int index)
 
Vector3 GetNormal (int index)
 Returns normal at index of ParticleState. More...
 
Vector3 GetLocalNormal (int index)
 
Color32[] GetColors ()
 Returns colors in ParticleState. More...
 
Vector3[] GetPositions ()
 Returns positions in ParticleState. More...
 
Vector3[] GetNormals ()
 Returns normals in ParticleState. More...
 
void SetColor (int index, Color32 c)
 Sets color at index of ParticleState. More...
 
void SetPosition (int index, Vector3 v)
 Sets position at index of ParticleState. More...
 
void SetNormal (int index, Vector3 v)
 Sets normal at index of ParticleState. More...
 
Vector3 GetParentedPosition (int thisPosition)
 Returns position from parent's TransformPoint (can only be called from main-thread). More...
 
ParticleStateC Clone ()
 Returns a copy of this ParticleState. More...
 

Public Attributes

Texture2D stateTexture
 The texture to construct this state from (used to color each vertex if mesh is used). More...
 
Texture2D stateDepthmap
 The texture to use as depthmap for this state. A grayscale image of the same size as stateTexture is required. More...
 
float stateDepthmapStrength = 1f
 How much the grayscale from stateDepthmap will affect z-value. More...
 
Mesh stateMesh
 The mesh used to set this state's positions. Positions will be calculated per vertex. More...
 
string stateName
 The name of this state. More...
 
float stateScale = 1f
 The scale of this state (measured in units). More...
 
Vector3 stateOffset
 The offset of this state in world position (measured in units). More...
 
Transform stateTransform
 The transform that act as parent to this state. More...
 
Matrix4x4 stateTransformMx = new Matrix4x4()
 
ScaleMethod stateScaleMethod
 
bool initialized = false
 Is this ParticleState intialized? More...
 
int colorLength
 The length of color array. More...
 
int positionLength
 The length of position array. More...
 
bool applyChromaKey
 
Color32 chromaKey
 
float chromaKeySpread
 

Detailed Description

Holds information about a State source.

Member Function Documentation

ParticleStateC ParticlePlayground.ParticleStateC.Clone ( )

Returns a copy of this ParticleState.

void ParticlePlayground.ParticleStateC.ConstructParticles ( Texture2D  image,
float  scale,
Vector3  offset,
string  newStateName,
Transform  newStateTransform 
)

Constructs image data.

Parameters
imageImage.
scaleScale.
offsetOffset.
newStateNameNew state name.
newStateTransformNew state transform.
void ParticlePlayground.ParticleStateC.ConstructParticles ( Mesh  mesh,
Texture2D  texture,
float  scale,
Vector3  offset,
string  newStateName,
Transform  newStateTransform 
)

Constructs Mesh data with texture.

Parameters
meshMesh.
textureTexture.
scaleScale.
offsetOffset.
newStateNameNew state name.
newStateTransformNew state transform.
void ParticlePlayground.ParticleStateC.ConstructParticles ( Mesh  mesh,
float  scale,
Vector3  offset,
string  newStateName,
Transform  newStateTransform 
)

Constructs Mesh data without texture.

Parameters
meshMesh.
scaleScale.
offsetOffset.
newStateNameNew state name.
newStateTransformNew state transform.
Color32 ParticlePlayground.ParticleStateC.GetColor ( int  index)

Returns color at index of ParticleState.

Returns
The color.
Parameters
indexIndex.
Color32 [] ParticlePlayground.ParticleStateC.GetColors ( )

Returns colors in ParticleState.

Returns
The colors.
Vector3 ParticlePlayground.ParticleStateC.GetNormal ( int  index)

Returns normal at index of ParticleState.

Returns
The normal.
Parameters
indexIndex.
Vector3 [] ParticlePlayground.ParticleStateC.GetNormals ( )

Returns normals in ParticleState.

Returns
The normals.
Vector3 ParticlePlayground.ParticleStateC.GetParentedPosition ( int  thisPosition)

Returns position from parent's TransformPoint (can only be called from main-thread).

Returns
The parented position.
Parameters
thisPositionThis position.
Vector3 ParticlePlayground.ParticleStateC.GetPosition ( int  index)

Returns position at index of ParticleState.

Returns
The position.
Parameters
indexIndex.
Vector3 [] ParticlePlayground.ParticleStateC.GetPositions ( )

Returns positions in ParticleState.

Returns
The positions.
void ParticlePlayground.ParticleStateC.Initialize ( )

Initializes a ParticleState for construction.

bool ParticlePlayground.ParticleStateC.IsInitializing ( )

Determines whether this State is initializing. This is used for multithreading to determine if a State's Initialize() function is being executed.

Returns
true if this State is initializing; otherwise, false.
void ParticlePlayground.ParticleStateC.SetColor ( int  index,
Color32  c 
)

Sets color at index of ParticleState.

Parameters
indexIndex.
cC.
void ParticlePlayground.ParticleStateC.SetNormal ( int  index,
Vector3  v 
)

Sets normal at index of ParticleState.

Parameters
indexIndex.
vV.
void ParticlePlayground.ParticleStateC.SetPosition ( int  index,
Vector3  v 
)

Sets position at index of ParticleState.

Parameters
indexIndex.
vV.

Member Data Documentation

int ParticlePlayground.ParticleStateC.colorLength

The length of color array.

bool ParticlePlayground.ParticleStateC.initialized = false

Is this ParticleState intialized?

int ParticlePlayground.ParticleStateC.positionLength

The length of position array.

Texture2D ParticlePlayground.ParticleStateC.stateDepthmap

The texture to use as depthmap for this state. A grayscale image of the same size as stateTexture is required.

float ParticlePlayground.ParticleStateC.stateDepthmapStrength = 1f

How much the grayscale from stateDepthmap will affect z-value.

Mesh ParticlePlayground.ParticleStateC.stateMesh

The mesh used to set this state's positions. Positions will be calculated per vertex.

string ParticlePlayground.ParticleStateC.stateName

The name of this state.

Vector3 ParticlePlayground.ParticleStateC.stateOffset

The offset of this state in world position (measured in units).

float ParticlePlayground.ParticleStateC.stateScale = 1f

The scale of this state (measured in units).

Texture2D ParticlePlayground.ParticleStateC.stateTexture

The texture to construct this state from (used to color each vertex if mesh is used).

Transform ParticlePlayground.ParticleStateC.stateTransform

The transform that act as parent to this state.


The documentation for this class was generated from the following file: