Feel  4.0.1
The best way to improve your game's feel and make it extra juicy
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 { PositionModes.FeedbackPosition, PositionModes.Transform, PositionModes.WorldPosition, PositionModes.Script }
 
enum  Modes { Modes.Cached, Modes.OnDemand, Modes.Pool }
 

Public Attributes

Modes Mode = Modes.Pool
 whether the particle system should be cached or created on demand the first time More...
 
int ObjectPoolSize = 5
 the initial and planned size of this object pool More...
 
bool MutualizePools = false
 whether or not to create a new pool even if one already exists for that same prefab More...
 
Transform ParentTransform
 if specified, the instantiated object (or the pool of objects) will be parented to this transform More...
 
bool CachedRecycle = true
 if this is false, a brand new particle system will be created every time More...
 
ParticleSystem ParticlesPrefab
 the particle system to spawn More...
 
List< ParticleSystem > RandomParticlePrefabs
 the possible random particle systems More...
 
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 More...
 
bool StopOnReset = false
 if this is true, the particle system will be stopped every time the feedback is reset - usually before play More...
 
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. More...
 
PositionModes PositionMode = PositionModes.FeedbackPosition
 the selected position mode More...
 
Transform InstantiateParticlesPosition
 the position at which to spawn this particle system More...
 
Vector3 TargetWorldPosition
 the world position to move to when in WorldPosition mode More...
 
Vector3 Offset
 an offset to apply to the instantiation position More...
 
bool NestParticles = true
 whether or not the particle system should be nested in hierarchy or floating on its own More...
 
bool ApplyRotation = false
 whether or not to also apply rotation More...
 
bool ApplyScale = false
 whether or not to also apply scale More...
 
bool ForceSimulationSpeed = false
 whether or not to force a specific simulation speed on the target particle system(s) More...
 
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. More...
 

Static Public Attributes

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

Protected Member Functions

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

Protected Attributes

ParticleSystem _instantiatedParticleSystem
 
List< ParticleSystem > _instantiatedRandomParticleSystems
 
MMMiniObjectPooler _objectPooler
 
GameObject _newGameObject
 
bool _poolCreatedOrFound = false
 
virtual bool ShouldCache => (Mode == Modes.OnDemand && CachedRecycle) || (Mode == Modes.Cached)
 

Properties

override float FeedbackDuration [get, set]
 

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 
)
protectedvirtual

On Play, plays the feedback

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ 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

◆ 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

◆ _poolCreatedOrFound

bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation._poolCreatedOrFound = false
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)

◆ InstantiateParticlesPosition

Transform MoreMountains.Feedbacks.MMF_ParticlesInstantiation.InstantiateParticlesPosition

the position at which to spawn this particle system

◆ 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

◆ ShouldCache

virtual bool MoreMountains.Feedbacks.MMF_ParticlesInstantiation.ShouldCache => (Mode == Modes.OnDemand && CachedRecycle) || (Mode == Modes.Cached)
protected

◆ 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

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