TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.Feedbacks.MMF_ParticlesInstantiation Class Reference

This feedback will instantiate a particle system and play/stop it when playing/stopping the feedback. More...

Inheritance diagram for MoreMountains.Feedbacks.MMF_ParticlesInstantiation:
MoreMountains.Feedbacks.MMF_Feedback

Public Types

enum  PositionModes { FeedbackPosition , Transform , WorldPosition , Script }
enum  Modes { Cached , OnDemand , Pool }

Public Attributes

Modes Mode = Modes.Pool
 whether the particle system should be cached or created on demand the first time
int ObjectPoolSize = 5
 the initial and planned size of this object pool
bool MutualizePools = false
 whether or not to create a new pool even if one already exists for that same prefab
Transform ParentTransform
 if specified, the instantiated object (or the pool of objects) will be parented to this transform
bool CachedRecycle = true
 if this is false, a brand new particle system will be created every time
ParticleSystem ParticlesPrefab
 the particle system to spawn
List< ParticleSystem > RandomParticlePrefabs
 the possible random particle systems
int MainParticlesPrefabWeight = 1
List< int > RandomParticleWeights = new List<int>()
bool ForceSetActiveOnPlay = false
 if this is true, the particle system game object will be activated on Play, useful if you've somehow disabled it in a past Play
bool StopOnReset = false
 if this is true, the particle system will be stopped every time the feedback is reset - usually before play
float DeclaredDuration = 0f
 the duration for the player to consider. This won't impact your particle system, but is a way to communicate to the MMF Player the duration of this feedback. Usually you'll want it to match your actual particle system, and setting it can be useful to have this feedback work with holding pauses.
bool ForceStopAction = false
 set this to true to override the target particle system(s) StopAction, forcing a disable or destroy for instance when the particle system stops. If you're pooling your particle systems, don't have them destroy on stop
ParticleSystemStopAction StopAction = ParticleSystemStopAction.None
 if ForceStopAction is true, this will override the target particle system(s) StopAction
PositionModes PositionMode = PositionModes.FeedbackPosition
 the selected position mode
Transform InstantiateParticlesPosition
 the position at which to spawn this particle system
Vector3 TargetWorldPosition
 the world position to move to when in WorldPosition mode
Vector3 Offset
 an offset to apply to the instantiation position
bool NestParticles = true
 whether or not the particle system should be nested in hierarchy or floating on its own
bool ApplyRotation = false
 whether or not to also apply rotation
bool ApplyScale = false
 whether or not to also apply scale
bool ForceSimulationSpeed = false
 whether or not to force a specific simulation speed on the target particle system(s)
Vector2 ForcedSimulationSpeed = new Vector2(0.1f,1f)
 The min and max values at which to randomize the simulation speed, if ForceSimulationSpeed is true. A new value will be randomized every time this feedback plays.

Static Public Attributes

static bool FeedbackTypeAuthorized = true
 a static bool used to disable all feedbacks of this type at once

Protected Member Functions

override void CustomInitialization (MMF_Player owner)
 On init, instantiates the particle system, positions it and nests it if needed.
virtual void CreatePools (MMF_Player owner)
virtual void CacheParticleSystem ()
virtual void InitializeWeights ()
virtual void InstantiateParticleSystem ()
 Instantiates the particle system.
virtual void PositionParticleSystem (ParticleSystem system)
virtual Quaternion GetRotation (Transform target)
 Gets the desired rotation of that particle system.
virtual Vector3 GetScale (Transform target)
 Gets the desired scale of that particle system.
virtual Vector3 GetPosition (Vector3 position)
 Gets the position.
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play, plays the feedback.
virtual void PlayTargetParticleSystem (ParticleSystem targetParticleSystem)
 Forces the sim speed if needed, then plays the target particle system.
virtual void GrabCachedParticleSystem ()
 Grabs and stores a random particle prefab.
override void CustomStopFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Stop, stops the feedback.
override void CustomReset ()
 On Reset, stops the feedback.

Protected Attributes

ParticleSystem _instantiatedParticleSystem
List< ParticleSystem > _instantiatedRandomParticleSystems
MMMiniObjectPooler _objectPooler
List< MMMiniObjectPooler_objectPoolers
GameObject _newGameObject
bool _poolCreatedOrFound = false
Vector3 _scriptPosition
MMShufflebag< int > _weightShuffleBag

Properties

override float FeedbackDuration [get, set]
ParticleSystem InstantiatedParticleSystem [get]
 the particle system instantiated by this feedback
List< ParticleSystem > InstantiatedRandomParticleSystems [get]
 the particle systems instantiated by this feedback
virtual bool ShouldCache [get]

Additional Inherited Members

Detailed Description

This feedback will instantiate a particle system and play/stop it when playing/stopping the feedback.

Member Enumeration Documentation

◆ Modes

the possible delivery modes

  • cached : will cache a copy of the particle system and reuse it
  • on demand : will instantiate a new particle system for every play
Enumerator
Cached 
OnDemand 
Pool 

◆ PositionModes

the different ways to position the instantiated object :

  • FeedbackPosition : object will be instantiated at the position of the feedback, plus an optional offset
  • Transform : the object will be instantiated at the specified Transform's position, plus an optional offset
  • WorldPosition : the object will be instantiated at the specified world position vector, plus an optional offset
  • Script : the position passed in parameters when calling the feedback
Enumerator
FeedbackPosition 
Transform 
WorldPosition 
Script 

Member Function Documentation

◆ CacheParticleSystem()

virtual void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.CacheParticleSystem ( )
protectedvirtual

◆ CreatePools()

virtual void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.CreatePools ( MMF_Player owner)
protectedvirtual

◆ CustomInitialization()

override void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.CustomInitialization ( MMF_Player owner)
protectedvirtual

On init, instantiates the particle system, positions it and nests it if needed.

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.CustomPlayFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protected

On Play, plays the feedback.

Parameters
position
feedbacksIntensity

◆ CustomReset()

override void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.CustomReset ( )
protectedvirtual

On Reset, stops the feedback.

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomStopFeedback()

override void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.CustomStopFeedback ( Vector3 position,
float feedbacksIntensity = 1::0f )
protectedvirtual

On Stop, stops the feedback.

Parameters
position
feedbacksIntensity

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ GetPosition()

virtual Vector3 MoreMountains.Feedbacks.MMF_ParticlesInstantiation.GetPosition ( Vector3 position)
protectedvirtual

Gets the position.

Parameters
position
Returns

◆ GetRotation()

virtual Quaternion MoreMountains.Feedbacks.MMF_ParticlesInstantiation.GetRotation ( Transform target)
protectedvirtual

Gets the desired rotation of that particle system.

Parameters
target
Returns

◆ GetScale()

virtual Vector3 MoreMountains.Feedbacks.MMF_ParticlesInstantiation.GetScale ( Transform target)
protectedvirtual

Gets the desired scale of that particle system.

Parameters
target
Returns

◆ GrabCachedParticleSystem()

virtual void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.GrabCachedParticleSystem ( )
protectedvirtual

Grabs and stores a random particle prefab.

◆ InitializeWeights()

virtual void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.InitializeWeights ( )
protectedvirtual

◆ InstantiateParticleSystem()

virtual void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.InstantiateParticleSystem ( )
protectedvirtual

Instantiates the particle system.

◆ PlayTargetParticleSystem()

virtual void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.PlayTargetParticleSystem ( ParticleSystem targetParticleSystem)
protectedvirtual

Forces the sim speed if needed, then plays the target particle system.

Parameters
targetParticleSystem

◆ PositionParticleSystem()

virtual void MoreMountains.Feedbacks.MMF_ParticlesInstantiation.PositionParticleSystem ( ParticleSystem system)
protectedvirtual

Member Data Documentation

◆ _instantiatedParticleSystem

ParticleSystem MoreMountains.Feedbacks.MMF_ParticlesInstantiation._instantiatedParticleSystem
protected

◆ _instantiatedRandomParticleSystems

List<ParticleSystem> MoreMountains.Feedbacks.MMF_ParticlesInstantiation._instantiatedRandomParticleSystems
protected

◆ _newGameObject

GameObject MoreMountains.Feedbacks.MMF_ParticlesInstantiation._newGameObject
protected

◆ _objectPooler

MMMiniObjectPooler MoreMountains.Feedbacks.MMF_ParticlesInstantiation._objectPooler
protected

◆ _objectPoolers

List<MMMiniObjectPooler> MoreMountains.Feedbacks.MMF_ParticlesInstantiation._objectPoolers
protected

◆ _poolCreatedOrFound

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation._poolCreatedOrFound = false
protected

◆ _scriptPosition

Vector3 MoreMountains.Feedbacks.MMF_ParticlesInstantiation._scriptPosition
protected

◆ _weightShuffleBag

MMShufflebag<int> MoreMountains.Feedbacks.MMF_ParticlesInstantiation._weightShuffleBag
protected

◆ ApplyRotation

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ApplyRotation = false

whether or not to also apply rotation

◆ ApplyScale

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ApplyScale = false

whether or not to also apply scale

◆ CachedRecycle

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.CachedRecycle = true

if this is false, a brand new particle system will be created every time

◆ DeclaredDuration

float MoreMountains.Feedbacks.MMF_ParticlesInstantiation.DeclaredDuration = 0f

the duration for the player to consider. This won't impact your particle system, but is a way to communicate to the MMF Player the duration of this feedback. Usually you'll want it to match your actual particle system, and setting it can be useful to have this feedback work with holding pauses.

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.FeedbackTypeAuthorized = true
static

a static bool used to disable all feedbacks of this type at once

◆ ForcedSimulationSpeed

Vector2 MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ForcedSimulationSpeed = new Vector2(0.1f,1f)

The min and max values at which to randomize the simulation speed, if ForceSimulationSpeed is true. A new value will be randomized every time this feedback plays.

◆ ForceSetActiveOnPlay

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ForceSetActiveOnPlay = false

if this is true, the particle system game object will be activated on Play, useful if you've somehow disabled it in a past Play

◆ ForceSimulationSpeed

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ForceSimulationSpeed = false

whether or not to force a specific simulation speed on the target particle system(s)

◆ ForceStopAction

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ForceStopAction = false

set this to true to override the target particle system(s) StopAction, forcing a disable or destroy for instance when the particle system stops. If you're pooling your particle systems, don't have them destroy on stop

◆ InstantiateParticlesPosition

Transform MoreMountains.Feedbacks.MMF_ParticlesInstantiation.InstantiateParticlesPosition

the position at which to spawn this particle system

◆ MainParticlesPrefabWeight

int MoreMountains.Feedbacks.MMF_ParticlesInstantiation.MainParticlesPrefabWeight = 1

◆ Mode

Modes MoreMountains.Feedbacks.MMF_ParticlesInstantiation.Mode = Modes.Pool

whether the particle system should be cached or created on demand the first time

◆ MutualizePools

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.MutualizePools = false

whether or not to create a new pool even if one already exists for that same prefab

◆ NestParticles

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.NestParticles = true

whether or not the particle system should be nested in hierarchy or floating on its own

◆ ObjectPoolSize

int MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ObjectPoolSize = 5

the initial and planned size of this object pool

◆ Offset

Vector3 MoreMountains.Feedbacks.MMF_ParticlesInstantiation.Offset

an offset to apply to the instantiation position

◆ ParentTransform

Transform MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ParentTransform

if specified, the instantiated object (or the pool of objects) will be parented to this transform

◆ ParticlesPrefab

ParticleSystem MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ParticlesPrefab

the particle system to spawn

◆ PositionMode

PositionModes MoreMountains.Feedbacks.MMF_ParticlesInstantiation.PositionMode = PositionModes.FeedbackPosition

the selected position mode

◆ RandomParticlePrefabs

List<ParticleSystem> MoreMountains.Feedbacks.MMF_ParticlesInstantiation.RandomParticlePrefabs

the possible random particle systems

◆ RandomParticleWeights

List<int> MoreMountains.Feedbacks.MMF_ParticlesInstantiation.RandomParticleWeights = new List<int>()

◆ StopAction

ParticleSystemStopAction MoreMountains.Feedbacks.MMF_ParticlesInstantiation.StopAction = ParticleSystemStopAction.None

if ForceStopAction is true, this will override the target particle system(s) StopAction

◆ StopOnReset

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.StopOnReset = false

if this is true, the particle system will be stopped every time the feedback is reset - usually before play

◆ TargetWorldPosition

Vector3 MoreMountains.Feedbacks.MMF_ParticlesInstantiation.TargetWorldPosition

the world position to move to when in WorldPosition mode

Property Documentation

◆ FeedbackDuration

override float MoreMountains.Feedbacks.MMF_ParticlesInstantiation.FeedbackDuration
getset

◆ InstantiatedParticleSystem

ParticleSystem MoreMountains.Feedbacks.MMF_ParticlesInstantiation.InstantiatedParticleSystem
get

the particle system instantiated by this feedback

◆ InstantiatedRandomParticleSystems

List<ParticleSystem> MoreMountains.Feedbacks.MMF_ParticlesInstantiation.InstantiatedRandomParticleSystems
get

the particle systems instantiated by this feedback

◆ ShouldCache

virtual bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ShouldCache
getprotected

The documentation for this class was generated from the following file:
  • H:/Code/MoreMountains/topdownengine/Assets/TopDownEngine/ThirdParty/MoreMountains/MMFeedbacks/MMFeedbacks/Feedbacks/MMF_ParticlesInstantiation.cs