Particle Playground - Script Reference
3.0.1
Framework for controlling particles in the Unity Engine.
|
The PlaygroundC class is the Playground Manager which runs all Particle Playground systems and is containing all Global Manipulators. The Playground Manager acts as a wrapper class for common operations and contain functions for creating and altering particle systems. You will also find the global event delegates (particleEventBirth, particleEventDeath, particleEventCollision and particleEventTime) for any particle systems broadcasting events with "Send To Manager" enabled. More...
Public Member Functions | |
bool | IsDoneThread () |
Determines whether the thread for threadMethod if set to ThreadMethod.OneForAll is finished. This is always true when any other method is selected. More... | |
bool | IsDoneThreadTurbulence () |
Determines whether the thread for turbulence is done. More... | |
bool | IsDoneThreadSkinnedMeshes () |
Determines whether the thread for skinned meshes is done. More... | |
bool | IsFirstUnsafeAutomaticFrames () |
Determines whether the multithreading is within the initial first unsafe frames. More... | |
bool | HasEnabledGlobalManipulators () |
Determines whether there is enabled global manipulators which should be calculated. More... | |
IEnumerator | InitializePlayground () |
Initializes the Playground Manager. More... | |
Static Public Member Functions | |
static void | SendParticleEventBirth (PlaygroundEventParticle eventParticle) |
Sends the particle event birth. More... | |
static void | SendParticleEventDeath (PlaygroundEventParticle eventParticle) |
Sends the particle event death. More... | |
static void | SendParticleEventCollision (PlaygroundEventParticle eventParticle) |
Sends the particle event collision. More... | |
static void | SendParticleEventTime (PlaygroundEventParticle eventParticle) |
Sends the particle event time. More... | |
static PlaygroundParticlesC | Particle () |
Creates a PlaygroundParticlesC object by standard prefab More... | |
static PlaygroundParticlesC | ParticleNew () |
Creates an empty PlaygroundParticlesC object by script More... | |
static PlaygroundParticlesC | Particle (Texture2D image, string name, Vector3 position, Quaternion rotation, Vector3 offset, float particleSize, float scale, Material material) |
Creates a PlaygroundParticlesC object with an image state. More... | |
static PlaygroundParticlesC | Particle (Texture2D image) |
Creates a PlaygroundParticlesC object with an image state. More... | |
static PlaygroundParticlesC | Particle (Texture2D[] images, string name, Vector3 position, Quaternion rotation, Vector3 offset, float particleSize, float scale, Material material) |
Creates a PlaygroundParticlesC object with several image states. More... | |
static PlaygroundParticlesC | Particle (Texture2D[] images) |
Creates a PlaygroundParticlesC object with several image states. More... | |
static PlaygroundParticlesC | Particle (Mesh mesh, Texture2D texture, string name, Vector3 position, Quaternion rotation, float particleScale, Vector3 offset, Material material) |
Creates a PlaygroundParticlesC object with a mesh state. More... | |
static PlaygroundParticlesC | Particle (Mesh mesh, Texture2D texture) |
Creates a PlaygroundParticlesC object with a mesh state. More... | |
static PlaygroundParticlesC | Particle (Mesh[] meshes, Texture2D[] textures, string name, Vector3 position, Quaternion rotation, float particleScale, Vector3[] offsets, Material material) |
Creates a PlaygroundParticlesC object with several mesh states. More... | |
static PlaygroundParticlesC | Particle (Mesh[] meshes, Texture2D[] textures) |
Creates a PlaygroundParticlesC object with several mesh states. More... | |
static int | Emit (PlaygroundParticlesC playgroundParticles) |
Emits next particle - using the particle system as a pool (note that you need to set scriptedEmission-variables on beforehand using this method). Returns emitted particle number. More... | |
static int | Emit (PlaygroundParticlesC playgroundParticles, Vector3 position, Vector3 normal, Color color) |
Emits next particle while setting scriptedEmission data - using the particle system as a pool. Returns emitted particle number. More... | |
static void | Emit (PlaygroundParticlesC playgroundParticles, bool setEmission) |
Sets emission on/off. More... | |
static void | GetPosition (SkinnedWorldObject particleStateWorldObject, bool updateNormals) |
Gets vertices and normals from a skinned world object in Vector3[] format (notice that the array is modified by reference). More... | |
static void | GetPosition (Vector3[] vertices, WorldObject particleStateWorldObject) |
Gets vertices from a world object in Vector3[] format (notice that the array is modified by reference). More... | |
static void | GetNormals (Vector3[] normals, WorldObject particleStateWorldObject) |
Gets normals from a world object in Vector3[] format (notice that the array is modified by reference). More... | |
static void | SetAlpha (PlaygroundParticlesC playgroundParticles, float alpha) |
Sets alpha of particles instantly. More... | |
static void | SetSize (PlaygroundParticlesC playgroundParticles, float size) |
Sets particle size. More... | |
static void | Translate (PlaygroundParticlesC playgroundParticles, Vector3 direction) |
Translates all particles in Particle System. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, ParticleStateC state) |
Adds a single state. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Texture2D image, float scale, Vector3 offset, string stateName) |
Adds a single state image. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Texture2D image, float scale, Vector3 offset, string stateName, Transform stateTransform) |
Adds a single state image with transform. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Texture2D image, Texture2D depthmap, float depthmapStrength, float scale, Vector3 offset, string stateName) |
Adds a single state image with depthmap. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Texture2D image, Texture2D depthmap, float depthmapStrength, float scale, Vector3 offset, string stateName, Transform stateTransform) |
Adds single state image with depthmap and transform. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Mesh mesh, float scale, Vector3 offset, string stateName) |
Adds a single state mesh. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Mesh mesh, float scale, Vector3 offset, string stateName, Transform stateTransform) |
Adds a single state mesh with transform. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Mesh mesh, Texture2D texture, float scale, Vector3 offset, string stateName) |
Adds a single state mesh with texture. More... | |
static void | Add (PlaygroundParticlesC playgroundParticles, Mesh mesh, Texture2D texture, float scale, Vector3 offset, string stateName, Transform stateTransform) |
Adds a single state mesh with texture and transform. More... | |
static PlaygroundColliderC | AddCollider (PlaygroundParticlesC playgroundParticles) |
Adds a plane collider. More... | |
static PlaygroundColliderC | AddCollider (PlaygroundParticlesC playgroundParticles, Transform transform) |
Adds a plane collider and assign a transform. More... | |
static void | SetParticleCount (PlaygroundParticlesC playgroundParticles, int amount) |
Sets amount of particles for this Particle System. More... | |
static void | SetLifetime (PlaygroundParticlesC playgroundParticles, float time) |
Sets lifetime for this Particle System. More... | |
static void | SetMaterial (PlaygroundParticlesC playgroundParticles, Material particleMaterial) |
Sets material for this Particle System. More... | |
static void | Destroy (PlaygroundParticlesC playgroundParticles) |
Destroys the passed in Particle System. More... | |
static WorldObject | WorldObject (Transform meshTransform) |
Creates a world object reference (used for live world positioning of particles towards a mesh). More... | |
static SkinnedWorldObject | SkinnedWorldObject (Transform meshTransform) |
Creates a skinned world object reference (used for live world positioning of particles towards a mesh). More... | |
static ManipulatorObjectC | ManipulatorObject (MANIPULATORTYPEC type, LayerMask affects, Transform manipulatorTransform, float size, float strength) |
Creates a manipulator object. More... | |
static ManipulatorObjectC | ManipulatorObject (Transform manipulatorTransform) |
Creates a manipulator object by transform. More... | |
static ManipulatorObjectC | ManipulatorObject (MANIPULATORTYPEC type, LayerMask affects, Transform manipulatorTransform, float size, float strength, PlaygroundParticlesC playgroundParticles) |
Create a manipulator in a PlaygroundParticlesC object More... | |
static ManipulatorObjectC | ManipulatorObject (Transform manipulatorTransform, PlaygroundParticlesC playgroundParticles) |
Creates a manipulator in a PlaygroundParticlesC object by transform. More... | |
static ManipulatorObjectC | GetManipulator (int i) |
Returns a global manipulator in array position. More... | |
static ManipulatorObjectC | GetManipulator (int i, PlaygroundParticlesC playgroundParticles) |
Returns a manipulator in a PlaygroundParticlesC object in array position. More... | |
static List < PlaygroundEventParticle > | GetManipulatorParticles (int manipulator, PlaygroundParticlesC playgroundParticles) |
Returns all current particles within a local manipulator (in form of an Event Particle, however no event will be needed). More... | |
static List < PlaygroundEventParticle > | GetManipulatorParticles (int manipulator) |
Returns all current particles within a global manipulator (in form of an Event Particle, however no event will be needed). More... | |
static Transform | CreateTransform () |
static Transform | CreatePlaygroundTransform (PlaygroundParticlesC playgroundParticles) |
static PlaygroundSpline | CreateSpline () |
Creates a new Playground Spline. The spline will be attached to a new GameObject in your scene by the name "Playground Spline". More... | |
static PlaygroundSpline | CreateSpline (PlaygroundParticlesC playgroundParticles) |
Creates a new Playground Spline. The spline will be attached to a new GameObject in your scene by the name "Playground Spline" which is parented to the passed in Particle Playground system. The Particle Playground system will have the source spline automatically set. More... | |
static PlaygroundSpline | CreateSpline (ManipulatorPropertyC manipulatorProperty) |
static PlaygroundEventC | CreateEvent () |
Creates an empty event. More... | |
static PlaygroundEventC | CreateEvent (PlaygroundParticlesC playgroundParticles) |
Creates an event into passed particle system. More... | |
static PlaygroundEventC | GetEvent (int i, PlaygroundParticlesC playgroundParticles) |
Returns an event from PlaygroundParticlesC object in array position. More... | |
static void | RemoveEvent (int i, PlaygroundParticlesC playgroundParticles) |
Removes the event. More... | |
static PlaygroundParticlesC | GetParticles (int i) |
Returns a Particle Playground System in array position. More... | |
static ParticleProjectionC | ParticleProjection (PlaygroundParticlesC playgroundParticles) |
Creates a projection object reference. More... | |
static PaintObjectC | PaintObject (PlaygroundParticlesC playgroundParticles) |
Creates a paint object reference. More... | |
static int | Paint (PlaygroundParticlesC playgroundParticles, Vector3 position, Vector3 normal, Transform parent, Color32 color) |
Live paints into a PlaygroundParticlesC PaintObject's positions. More... | |
static void | Paint (PaintObjectC paintObject, Vector3 position, Vector3 normal, Transform parent, Color32 color) |
Live paints into a PaintObject's positions directly. More... | |
static bool | Erase (PlaygroundParticlesC playgroundParticles, Vector3 position, float radius) |
Live erases into a PlaygroundParticlesC PaintObject's positions, returns true if position was erased. More... | |
static bool | Erase (PaintObjectC paintObject, Vector3 position, float radius) |
Live erases into a PaintObject's positions directly, returns true if position was erased. More... | |
static bool | Erase (PlaygroundParticlesC playgroundParticles, int index) |
Live erases into a PlaygroundParticlesC PaintObject's using a specified index, returns true if position was erased. More... | |
static void | ClearPaint (PlaygroundParticlesC playgroundParticles) |
Clears out paint in a PlaygroundParticlesC object. More... | |
static int | GetPaintPositionLength (PlaygroundParticlesC playgroundParticles) |
Gets the amount of paint positions in this PlaygroundParticlesC PaintObject. More... | |
static void | SetInitialTargetPosition (PlaygroundParticlesC playgroundParticles, Vector3 position) |
Sets initial target position for this Particle System. More... | |
static void | Emission (PlaygroundParticlesC playgroundParticles, bool emit) |
Sets emission for this Particle System. More... | |
static void | Emission (PlaygroundParticlesC playgroundParticles, bool emit, bool restEmission) |
Set emission for this Particle System controlling to run rest emission More... | |
static void | Clear (PlaygroundParticlesC playgroundParticles) |
Clears out this Particle System. More... | |
static void | RefreshScatter (PlaygroundParticlesC playgroundParticles) |
Refreshes source scatter for this Particle System. More... | |
static PlaygroundParticlesC | InstantiatePreset (string presetName) |
Instantiates a preset by name reference. Any preset you wish to instantiate using the InstantiatePreset method needs to be in a 'Resources/Presets/' folder. More... | |
static PlaygroundParticlesC | InstantiatePreset (string categoryName, string presetName) |
Instantiates a preset by category and name reference. The category is the name of the folder. Any preset you wish to instantiate using this InstantiatePreset overload needs to be in a 'Resources/Presets/categoryName/' folder. More... | |
static bool | HasReference () |
Determines if the Playground Manager has its reference assigned. More... | |
static bool | HasPlaygroundPool () |
Determines if the Playground Manager has a Playground Pool assigned. More... | |
static Color32[] | GetPixels (Texture2D image) |
Returns pixels from a texture. More... | |
static Vector3 | Offset (PLAYGROUNDORIGINC origin, int imageWidth, int imageHeight, float meshScale) |
static Vector3[] | RandomVector3 (int length, Vector3 min, Vector3 max) |
Returns a random vector3-array. More... | |
static float[] | RandomFloat (int length, float min, float max) |
Returns a float array by random values. More... | |
static void | ShuffleArray (float[] arr) |
Shuffles an existing built-in float array. More... | |
static void | ShuffleArray (int[] arr) |
Shuffles an existing built-in int array. More... | |
static int | Largest (int[] compare) |
Compares and returns the largest number in an int array. More... | |
static int | CountZeroAlphasInTexture (Texture2D image) |
Counts the completely transparent pixels in a Texture2D. More... | |
static GameObject | ResourceInstantiate (string n) |
Instantiates from Resources. More... | |
static void | TimeReset () |
Reset time More... | |
static bool | IsReady () |
static void | SetTime () |
Updates the global time. More... | |
static void | SetMaxThreads (int threadCount) |
Sets the maximum threads allowed. When using Thread Pool Method: Playground Pool this will set the amount of reused threads. More... | |
static int | ActiveThreads () |
Returns the amount of current active threads created. More... | |
static int | ProcessorCount () |
static void | RunAsync (Action a, ThreadPoolMethod threadPoolMethod) |
Runs an action asynchrounously on a second thread. Use a lambda expression to pass data to another thread. More... | |
static void | RunAsync (Action a) |
static void | RunAsyncPlaygroundPool (Action a) |
Public Attributes | |
List< PlaygroundParticlesC > | particleSystems = new List<PlaygroundParticlesC>() |
The particle systems controlled by this Playground Manager. More... | |
List< ManipulatorObjectC > | manipulators = new List<ManipulatorObjectC>() |
The manipulators controlled by this Playground Manager. More... | |
int | paintMaxPositions = 10000 |
Maximum amount of emission positions in a PaintObject. More... | |
bool | calculate = true |
Calculate forces on PlaygroundParticlesC objects. More... | |
PIXELMODEC | pixelFilterMode = PIXELMODEC.Pixel32 |
Color filtering mode. More... | |
bool | autoGroup = true |
Automatically parent a PlaygroundParticlesC object to Playground if it has no parent. More... | |
bool | buildZeroAlphaPixels = false |
Turn this on if you want to build particles from 0 alpha pixels into states. More... | |
bool | drawGizmos = true |
Draw gizmos for manipulators and other particle system helpers in Scene View. More... | |
bool | drawSourcePositions = false |
Draw gizmos for source positions in Scene View. More... | |
bool | showShuriken = false |
Should the Shuriken particle system component be visible? (This is just a precaution as editing Shuriken can lead to unexpected behavior). More... | |
bool | paintToolbox = true |
Show toolbox in Scene View when Source is set to Paint on PlaygroundParticlesC objects. More... | |
float | collisionPlaneScale = .1f |
Scale of collision planes. More... | |
bool | showSnapshotsInHierarchy = false |
Should snapshots be visible in the Hieararchy? (Enable this if you want to edit snapshots). More... | |
bool | drawWireframe = false |
Should wireframes be rendered around particles in Scene View? More... | |
bool | drawSplinePreview = true |
Determines to draw previews of Playground Splines in Scene View. More... | |
bool | globalTimeScale = true |
Determines if Time.timeScale should affect the particle systems simulation time. If disabled you can keep simulating particles in normal speed detached from the scene's time scale. More... | |
ThreadPoolMethod | threadPoolMethod = ThreadPoolMethod.PlaygroundPool |
The thread pool method determines which thread pooling should be used. ThreadPoolMethod.ThreadPool will use the .NET managed ThreadPool class (standard in Particle Playground in versions prior to 3). ThreadPoolMethod.PlaygroundPool will use the self-managed PlaygroundQueue which queues tasks on reused threads (standard in Particle Playground 3 and up). More... | |
ThreadMethod | threadMethod = ThreadMethod.Automatic |
The multithreading method Particle Playground should use. This determines how particle systems calculate over the CPU. Keep in mind each thread will generate memory garbage which will be collected at some point. Selecting ThreadMethod.NoThreads will make particle systems calculate on the main-thread. ThreadMethod.OnePerSystem will create one thread per particle system each frame. ThreadMethod.OneForAll will bundle all calculations into one single thread. ThreadMethod.Automatic will distribute all particle systems evenly bundled along available CPUs/cores. This is the recommended setting for most user cases. More... | |
ThreadMethodComponent | skinnedMeshThreadMethod = ThreadMethodComponent.InsideParticleCalculation |
ThreadMethodComponent | turbulenceThreadMethod = ThreadMethodComponent.InsideParticleCalculation |
int | maxThreads = 8 |
The maximum amount of threads that can be created. The amount of created threads will never exceed available CPUs. More... | |
Static Public Attributes | |
static int | meshQuantity |
static int | particlesQuantity |
static float | version = 3f |
static string | specialVersion = " " |
static float | globalTime |
The global time. More... | |
static float | lastTimeUpdated |
Time when globalTime last updated. More... | |
static float | globalDeltaTime |
Delta time for globalTime (globalTime-lastTimeUpdated). More... | |
static float | globalTimescale = 1.0f |
Scaling of globalTime. More... | |
static Vector3 | initialTargetPosition = new Vector3(0,-999.99f,0) |
Initial spawn position when particle is not set to rebirth. More... | |
static int | skinnedUpdateRate = 1 |
Update rate for finding vertices in skinned meshes (1 = Every frame, 2 = Every second frame...). More... | |
static bool | triggerSceneRepaint = true |
Let a PlaygroundParticleWindow repaint the scene. More... | |
static float | collisionSleepVelocity = .01f |
Minimum velocity of a particle before it goes to rest on collision. More... | |
static int | unsafeAutomaticThreadFrames = 20 |
Determines how many frames are unsafe before initiating automatic thread bundling. More... | |
static Plane[] | frustumPlanes |
The frustum planes of the Main Camera. This is used to disable or enable calculation on particle systems when having PlaygroundParticlesC.pauseCalculationWhenInvisible enabled. More... | |
static PlaygroundC | reference |
Static reference to the Playground Manager script. More... | |
static Transform | referenceTransform |
Static reference to the Playground Manager Transform. More... | |
static GameObject | referenceGameObject |
Static reference to the Playground Manager GameObject. More... | |
static PlaygroundQueue< Action > | playgroundPool |
The Particle Playground-managed thread pool. The maxThreads value will determine how many threads will be available in the pool. More... | |
Events | |
static OnPlaygroundParticle | particleEventBirth |
The event of a particle birthing. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager. More... | |
static OnPlaygroundParticle | particleEventDeath |
The event of a particle dying. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager. More... | |
static OnPlaygroundParticle | particleEventCollision |
The event of a particle colliding. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager. More... | |
static OnPlaygroundParticle | particleEventTime |
The event of a particle sent by timer. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager. More... | |
The PlaygroundC class is the Playground Manager which runs all Particle Playground systems and is containing all Global Manipulators. The Playground Manager acts as a wrapper class for common operations and contain functions for creating and altering particle systems. You will also find the global event delegates (particleEventBirth, particleEventDeath, particleEventCollision and particleEventTime) for any particle systems broadcasting events with "Send To Manager" enabled.
|
static |
Returns the amount of current active threads created.
|
static |
Adds a single state.
playgroundParticles | Playground particles. |
state | State. |
|
static |
Adds a single state image.
playgroundParticles | Playground particles. |
image | Image. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
|
static |
Adds a single state image with transform.
playgroundParticles | Playground particles. |
image | Image. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
stateTransform | State transform. |
|
static |
Adds a single state image with depthmap.
playgroundParticles | Playground particles. |
image | Image. |
depthmap | Depthmap. |
depthmapStrength | Depthmap strength. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
|
static |
Adds single state image with depthmap and transform.
playgroundParticles | Playground particles. |
image | Image. |
depthmap | Depthmap. |
depthmapStrength | Depthmap strength. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
stateTransform | State transform. |
|
static |
Adds a single state mesh.
playgroundParticles | Playground particles. |
mesh | Mesh. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
|
static |
Adds a single state mesh with transform.
playgroundParticles | Playground particles. |
mesh | Mesh. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
stateTransform | State transform. |
|
static |
Adds a single state mesh with texture.
playgroundParticles | Playground particles. |
mesh | Mesh. |
texture | Texture. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
|
static |
Adds a single state mesh with texture and transform.
playgroundParticles | Playground particles. |
mesh | Mesh. |
texture | Texture. |
scale | Scale. |
offset | Offset. |
stateName | State name. |
stateTransform | State transform. |
|
static |
Adds a plane collider.
playgroundParticles | Playground particles. |
|
static |
Adds a plane collider and assign a transform.
playgroundParticles | Playground particles. |
transform | Transform. |
|
static |
Clears out this Particle System.
playgroundParticles | Playground particles. |
|
static |
Clears out paint in a PlaygroundParticlesC object.
playgroundParticles | Playground particles. |
|
static |
Counts the completely transparent pixels in a Texture2D.
image | Image. |
|
static |
Creates an empty event.
|
static |
Creates an event into passed particle system.
playgroundParticles | Particle Playground system. |
|
static |
Creates a new Playground Spline. The spline will be attached to a new GameObject in your scene by the name "Playground Spline".
|
static |
Creates a new Playground Spline. The spline will be attached to a new GameObject in your scene by the name "Playground Spline" which is parented to the passed in Particle Playground system. The Particle Playground system will have the source spline automatically set.
playgroundParticles | Particle Playground system. |
|
static |
Destroys the passed in Particle System.
playgroundParticles | Playground particles. |
|
static |
Sets emission for this Particle System.
playgroundParticles | Playground particles. |
emit | If set to true emit. |
|
static |
Set emission for this Particle System controlling to run rest emission
playgroundParticles | Playground particles. |
emit | If set to true emit. |
restEmission | If set to true rest emission. |
|
static |
Emits next particle - using the particle system as a pool (note that you need to set scriptedEmission-variables on beforehand using this method). Returns emitted particle number.
playgroundParticles | Playground particles. |
|
static |
Emits next particle while setting scriptedEmission data - using the particle system as a pool. Returns emitted particle number.
playgroundParticles | Playground particles. |
position | Position. |
normal | Normal. |
color | Color. |
|
static |
Sets emission on/off.
playgroundParticles | Playground particles. |
setEmission | If set to true set emission. |
|
static |
Live erases into a PlaygroundParticlesC PaintObject's positions, returns true if position was erased.
playgroundParticles | Playground particles. |
position | Position. |
radius | Radius. |
|
static |
Live erases into a PaintObject's positions directly, returns true if position was erased.
paintObject | Paint object. |
position | Position. |
radius | Radius. |
|
static |
Live erases into a PlaygroundParticlesC PaintObject's using a specified index, returns true if position was erased.
playgroundParticles | Playground particles. |
index | Index. |
|
static |
Returns an event from PlaygroundParticlesC object in array position.
i | The index. |
playgroundParticles | Particle Playground system. |
|
static |
Returns a global manipulator in array position.
i | The index. |
|
static |
Returns a manipulator in a PlaygroundParticlesC object in array position.
i | The index. |
playgroundParticles | Playground particles. |
|
static |
Returns all current particles within a local manipulator (in form of an Event Particle, however no event will be needed).
manipulator | Manipulator. |
playgroundParticles | Playground particles. |
|
static |
Returns all current particles within a global manipulator (in form of an Event Particle, however no event will be needed).
manipulator | Manipulator. |
|
static |
Gets normals from a world object in Vector3[] format (notice that the array is modified by reference).
normals | Normals. |
particleStateWorldObject | World Object. |
|
static |
Gets the amount of paint positions in this PlaygroundParticlesC PaintObject.
playgroundParticles | Playground particles. |
|
static |
Returns a Particle Playground System in array position.
i | The index. |
|
static |
Returns pixels from a texture.
image | Image. |
|
static |
Gets vertices and normals from a skinned world object in Vector3[] format (notice that the array is modified by reference).
particleStateWorldObject | Skinned World Object. |
updateNormals | If set to true update normals. |
|
static |
Gets vertices from a world object in Vector3[] format (notice that the array is modified by reference).
vertices | Vertices. |
<param name="particleStateWorldObject"World Object.
bool ParticlePlayground.PlaygroundC.HasEnabledGlobalManipulators | ( | ) |
Determines whether there is enabled global manipulators which should be calculated.
true
if there is enabled global manipulators; otherwise, false
.
|
static |
Determines if the Playground Manager has a Playground Pool assigned.
true
if having a Playground Pool; otherwise, false
.
|
static |
Determines if the Playground Manager has its reference assigned.
true
if having a reference; otherwise, false
.IEnumerator ParticlePlayground.PlaygroundC.InitializePlayground | ( | ) |
Initializes the Playground Manager.
|
static |
Instantiates a preset by name reference. Any preset you wish to instantiate using the InstantiatePreset method needs to be in a 'Resources/Presets/' folder.
presetName | Preset name. |
|
static |
Instantiates a preset by category and name reference. The category is the name of the folder. Any preset you wish to instantiate using this InstantiatePreset overload needs to be in a 'Resources/Presets/categoryName/' folder.
categoryName | Category name. |
presetName | Preset name. |
bool ParticlePlayground.PlaygroundC.IsDoneThread | ( | ) |
Determines whether the thread for threadMethod if set to ThreadMethod.OneForAll is finished. This is always true when any other method is selected.
true
if the OneForAll thread is finished; otherwise, false
.bool ParticlePlayground.PlaygroundC.IsDoneThreadSkinnedMeshes | ( | ) |
Determines whether the thread for skinned meshes is done.
true
if the thread for skinned meshes is done; otherwise, false
.bool ParticlePlayground.PlaygroundC.IsDoneThreadTurbulence | ( | ) |
Determines whether the thread for turbulence is done.
true
if thread for turbulence is done; otherwise, false
.bool ParticlePlayground.PlaygroundC.IsFirstUnsafeAutomaticFrames | ( | ) |
Determines whether the multithreading is within the initial first unsafe frames.
true
if it is the first unsafe automatic frames; otherwise, false
.
|
static |
Compares and returns the largest number in an int array.
compare | Ints to compare. |
|
static |
Creates a manipulator object.
type | Type. |
affects | Affects. |
manipulatorTransform | Manipulator transform. |
size | Size. |
strength | Strength. |
|
static |
Creates a manipulator object by transform.
manipulatorTransform | Manipulator transform. |
|
static |
Create a manipulator in a PlaygroundParticlesC object
type | Type. |
affects | Affects. |
manipulatorTransform | Manipulator transform. |
size | Size. |
strength | Strength. |
playgroundParticles | Playground particles. |
|
static |
Creates a manipulator in a PlaygroundParticlesC object by transform.
manipulatorTransform | Manipulator transform. |
playgroundParticles | Playground particles. |
|
static |
Live paints into a PlaygroundParticlesC PaintObject's positions.
playgroundParticles | Playground particles. |
position | Position. |
normal | Normal. |
parent | Parent. |
color | Color. |
|
static |
Live paints into a PaintObject's positions directly.
paintObject | Paint object. |
position | Position. |
normal | Normal. |
parent | Parent. |
color | Color. |
|
static |
Creates a paint object reference.
playgroundParticles | Playground particles. |
|
static |
Creates a PlaygroundParticlesC object by standard prefab
|
static |
Creates a PlaygroundParticlesC object with an image state.
image | Image. |
name | Name. |
position | Position. |
rotation | Rotation. |
offset | Offset. |
particleSize | Particle size. |
scale | Scale. |
material | Material. |
|
static |
Creates a PlaygroundParticlesC object with an image state.
image | The particle system instance. |
|
static |
Creates a PlaygroundParticlesC object with several image states.
images | Images. |
name | Name. |
position | Position. |
rotation | Rotation. |
offset | Offset. |
particleSize | Particle size. |
scale | Scale. |
material | Material. |
|
static |
Creates a PlaygroundParticlesC object with several image states.
images | Images. |
|
static |
Creates a PlaygroundParticlesC object with a mesh state.
mesh | Mesh. |
texture | Texture. |
name | Name. |
position | Position. |
rotation | Rotation. |
particleScale | Particle scale. |
offset | Offset. |
material | Material. |
|
static |
Creates a PlaygroundParticlesC object with a mesh state.
mesh | Mesh. |
texture | Texture. |
|
static |
Creates a PlaygroundParticlesC object with several mesh states.
meshes | Meshes. |
textures | Textures. |
name | Name. |
position | Position. |
rotation | Rotation. |
particleScale | Particle scale. |
offsets | Offsets. |
material | Material. |
|
static |
Creates a PlaygroundParticlesC object with several mesh states.
meshes | Meshes. |
textures | Textures. |
|
static |
Creates an empty PlaygroundParticlesC object by script
|
static |
Creates a projection object reference.
playgroundParticles | Playground particles. |
|
static |
Returns a float array by random values.
length | Length. |
min | Minimum. |
max | Max. |
|
static |
Returns a random vector3-array.
length | Length. |
min | Minimum. |
max | Max. |
|
static |
Refreshes source scatter for this Particle System.
playgroundParticles | Playground particles. |
|
static |
Removes the event.
i | The index. |
playgroundParticles | Playground particles. |
|
static |
Instantiates from Resources.
n | N. |
|
static |
Runs an action asynchrounously on a second thread. Use a lambda expression to pass data to another thread.
a | The action. |
|
static |
Sends the particle event birth.
eventParticle | Event particle. |
|
static |
Sends the particle event collision.
eventParticle | Event particle. |
|
static |
Sends the particle event death.
eventParticle | Event particle. |
|
static |
Sends the particle event time.
eventParticle | Event particle. |
|
static |
Sets alpha of particles instantly.
playgroundParticles | Playground particles. |
alpha | Alpha. |
|
static |
Sets initial target position for this Particle System.
playgroundParticles | Playground particles. |
position | Position. |
|
static |
Sets lifetime for this Particle System.
playgroundParticles | Playground particles. |
time | Time. |
|
static |
Sets material for this Particle System.
playgroundParticles | Playground particles. |
particleMaterial | Particle material. |
|
static |
Sets the maximum threads allowed. When using Thread Pool Method: Playground Pool this will set the amount of reused threads.
threadCount | The amount of threads. |
|
static |
Sets amount of particles for this Particle System.
playgroundParticles | Playground particles. |
amount | Amount. |
|
static |
Sets particle size.
playgroundParticles | Playground particles. |
size | Size. |
|
static |
Updates the global time.
|
static |
Shuffles an existing built-in float array.
arr | Arr. |
|
static |
Shuffles an existing built-in int array.
arr | Arr. |
|
static |
Creates a skinned world object reference (used for live world positioning of particles towards a mesh).
meshTransform | Mesh transform. |
|
static |
Reset time
|
static |
Translates all particles in Particle System.
playgroundParticles | Playground particles. |
direction | Direction. |
|
static |
Creates a world object reference (used for live world positioning of particles towards a mesh).
meshTransform | Mesh transform. |
bool ParticlePlayground.PlaygroundC.autoGroup = true |
Automatically parent a PlaygroundParticlesC object to Playground if it has no parent.
bool ParticlePlayground.PlaygroundC.buildZeroAlphaPixels = false |
Turn this on if you want to build particles from 0 alpha pixels into states.
bool ParticlePlayground.PlaygroundC.calculate = true |
Calculate forces on PlaygroundParticlesC objects.
float ParticlePlayground.PlaygroundC.collisionPlaneScale = .1f |
Scale of collision planes.
|
static |
Minimum velocity of a particle before it goes to rest on collision.
bool ParticlePlayground.PlaygroundC.drawGizmos = true |
Draw gizmos for manipulators and other particle system helpers in Scene View.
bool ParticlePlayground.PlaygroundC.drawSourcePositions = false |
Draw gizmos for source positions in Scene View.
bool ParticlePlayground.PlaygroundC.drawSplinePreview = true |
Determines to draw previews of Playground Splines in Scene View.
bool ParticlePlayground.PlaygroundC.drawWireframe = false |
Should wireframes be rendered around particles in Scene View?
|
static |
The frustum planes of the Main Camera. This is used to disable or enable calculation on particle systems when having PlaygroundParticlesC.pauseCalculationWhenInvisible enabled.
|
static |
Delta time for globalTime (globalTime-lastTimeUpdated).
|
static |
The global time.
|
static |
Scaling of globalTime.
bool ParticlePlayground.PlaygroundC.globalTimeScale = true |
Determines if Time.timeScale should affect the particle systems simulation time. If disabled you can keep simulating particles in normal speed detached from the scene's time scale.
Initial spawn position when particle is not set to rebirth.
|
static |
Time when globalTime last updated.
List<ManipulatorObjectC> ParticlePlayground.PlaygroundC.manipulators = new List<ManipulatorObjectC>() |
The manipulators controlled by this Playground Manager.
int ParticlePlayground.PlaygroundC.maxThreads = 8 |
The maximum amount of threads that can be created. The amount of created threads will never exceed available CPUs.
int ParticlePlayground.PlaygroundC.paintMaxPositions = 10000 |
Maximum amount of emission positions in a PaintObject.
bool ParticlePlayground.PlaygroundC.paintToolbox = true |
Show toolbox in Scene View when Source is set to Paint on PlaygroundParticlesC objects.
List<PlaygroundParticlesC> ParticlePlayground.PlaygroundC.particleSystems = new List<PlaygroundParticlesC>() |
The particle systems controlled by this Playground Manager.
PIXELMODEC ParticlePlayground.PlaygroundC.pixelFilterMode = PIXELMODEC.Pixel32 |
Color filtering mode.
|
static |
The Particle Playground-managed thread pool. The maxThreads value will determine how many threads will be available in the pool.
|
static |
Static reference to the Playground Manager script.
|
static |
Static reference to the Playground Manager GameObject.
|
static |
Static reference to the Playground Manager Transform.
bool ParticlePlayground.PlaygroundC.showShuriken = false |
Should the Shuriken particle system component be visible? (This is just a precaution as editing Shuriken can lead to unexpected behavior).
bool ParticlePlayground.PlaygroundC.showSnapshotsInHierarchy = false |
Should snapshots be visible in the Hieararchy? (Enable this if you want to edit snapshots).
|
static |
Update rate for finding vertices in skinned meshes (1 = Every frame, 2 = Every second frame...).
ThreadMethod ParticlePlayground.PlaygroundC.threadMethod = ThreadMethod.Automatic |
The multithreading method Particle Playground should use. This determines how particle systems calculate over the CPU. Keep in mind each thread will generate memory garbage which will be collected at some point. Selecting ThreadMethod.NoThreads will make particle systems calculate on the main-thread. ThreadMethod.OnePerSystem will create one thread per particle system each frame. ThreadMethod.OneForAll will bundle all calculations into one single thread. ThreadMethod.Automatic will distribute all particle systems evenly bundled along available CPUs/cores. This is the recommended setting for most user cases.
ThreadPoolMethod ParticlePlayground.PlaygroundC.threadPoolMethod = ThreadPoolMethod.PlaygroundPool |
The thread pool method determines which thread pooling should be used. ThreadPoolMethod.ThreadPool will use the .NET managed ThreadPool class (standard in Particle Playground in versions prior to 3). ThreadPoolMethod.PlaygroundPool will use the self-managed PlaygroundQueue which queues tasks on reused threads (standard in Particle Playground 3 and up).
|
static |
Let a PlaygroundParticleWindow repaint the scene.
|
static |
Determines how many frames are unsafe before initiating automatic thread bundling.
|
static |
The event of a particle birthing. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager.
|
static |
The event of a particle colliding. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager.
|
static |
The event of a particle dying. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager.
|
static |
The event of a particle sent by timer. This require that you are using Event Listeners and set your desired particle system(s) to broadcast the event by enabling PlaygroundEventC.sendToManager.