Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Feedbacks.MMF_InstantiateObject Class Reference

This feedback will instantiate the associated object (usually a VFX, but not necessarily), optionnally creating an object pool of them for performance More...

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

Public Types

enum  PositionModes { PositionModes.FeedbackPosition, PositionModes.Transform, PositionModes.WorldPosition, PositionModes.Script }
 

Public Attributes

GameObject GameObjectToInstantiate
 sets the inspector color for this feedback More...
 
PositionModes PositionMode = PositionModes.FeedbackPosition
 the chosen way to position the object More...
 
bool AlsoApplyRotation = false
 the chosen way to position the object More...
 
bool AlsoApplyScale = false
 the chosen way to position the object More...
 
Transform TargetTransform
 the transform at which to instantiate the object More...
 
Vector3 TargetPosition
 the transform at which to instantiate the object More...
 
Vector3 PositionOffset
 the position offset at which to instantiate the object More...
 
bool RandomizePosition = false
 if this is true, instantiation position will be randomized between RandomizeMin and RandomizeMax More...
 
Vector3 RandomizedPositionMin = Vector3.zero
 the minimum value we'll randomize our position with More...
 
Vector3 RandomizedPositionMax = Vector3.one
 the maximum value we'll randomize our position with More...
 
Transform ParentTransform
 if specified, the instantiated object will be parented to this transform More...
 
bool CreateObjectPool
 whether or not we should create automatically an object pool for this object 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 PoolParentTransform
 the transform the pool of objects will be parented to 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 we create an object pool if needed More...
 
override void CustomPlayFeedback (Vector3 position, float feedbacksIntensity=1.0f)
 On Play we instantiate the specified object, either from the object pool or from scratch More...
 
virtual void PositionObject (Vector3 position)
 
virtual Vector3 GetPosition (Vector3 position)
 Gets the desired position of that particle system More...
 
virtual Quaternion GetRotation ()
 Gets the desired rotation of that particle system More...
 
virtual Vector3 GetScale ()
 Gets the desired scale of that particle system More...
 

Protected Attributes

MMMiniObjectPooler _objectPooler
 
GameObject _newGameObject
 
bool _poolCreatedOrFound = false
 
Vector3 _randomizedPosition = Vector3.zero
 

Additional Inherited Members

Detailed Description

This feedback will instantiate the associated object (usually a VFX, but not necessarily), optionnally creating an object pool of them for performance

Member Enumeration Documentation

◆ 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

◆ CustomInitialization()

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

On init we create an object pool if needed

Parameters
owner

Reimplemented from MoreMountains.Feedbacks.MMF_Feedback.

◆ CustomPlayFeedback()

override void MoreMountains.Feedbacks.MMF_InstantiateObject.CustomPlayFeedback ( Vector3  position,
float  feedbacksIntensity = 1.0f 
)
protectedvirtual

On Play we instantiate the specified object, either from the object pool or from scratch

Parameters
position
feedbacksIntensity

Implements MoreMountains.Feedbacks.MMF_Feedback.

◆ GetPosition()

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

Gets the desired position of that particle system

Parameters
position
Returns

◆ GetRotation()

virtual Quaternion MoreMountains.Feedbacks.MMF_InstantiateObject.GetRotation ( )
protectedvirtual

Gets the desired rotation of that particle system

Parameters
target
Returns

◆ GetScale()

virtual Vector3 MoreMountains.Feedbacks.MMF_InstantiateObject.GetScale ( )
protectedvirtual

Gets the desired scale of that particle system

Parameters
target
Returns

◆ PositionObject()

virtual void MoreMountains.Feedbacks.MMF_InstantiateObject.PositionObject ( Vector3  position)
protectedvirtual

Member Data Documentation

◆ _newGameObject

GameObject MoreMountains.Feedbacks.MMF_InstantiateObject._newGameObject
protected

◆ _objectPooler

MMMiniObjectPooler MoreMountains.Feedbacks.MMF_InstantiateObject._objectPooler
protected

◆ _poolCreatedOrFound

bool MoreMountains.Feedbacks.MMF_InstantiateObject._poolCreatedOrFound = false
protected

◆ _randomizedPosition

Vector3 MoreMountains.Feedbacks.MMF_InstantiateObject._randomizedPosition = Vector3.zero
protected

◆ AlsoApplyRotation

bool MoreMountains.Feedbacks.MMF_InstantiateObject.AlsoApplyRotation = false

the chosen way to position the object

◆ AlsoApplyScale

bool MoreMountains.Feedbacks.MMF_InstantiateObject.AlsoApplyScale = false

the chosen way to position the object

◆ CreateObjectPool

bool MoreMountains.Feedbacks.MMF_InstantiateObject.CreateObjectPool

whether or not we should create automatically an object pool for this object

◆ FeedbackTypeAuthorized

bool MoreMountains.Feedbacks.MMF_InstantiateObject.FeedbackTypeAuthorized = true
static

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

◆ GameObjectToInstantiate

GameObject MoreMountains.Feedbacks.MMF_InstantiateObject.GameObjectToInstantiate

sets the inspector color for this feedback

the object to instantiate

◆ MutualizePools

bool MoreMountains.Feedbacks.MMF_InstantiateObject.MutualizePools = false

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

◆ ObjectPoolSize

int MoreMountains.Feedbacks.MMF_InstantiateObject.ObjectPoolSize = 5

the initial and planned size of this object pool

◆ ParentTransform

Transform MoreMountains.Feedbacks.MMF_InstantiateObject.ParentTransform

if specified, the instantiated object will be parented to this transform

◆ PoolParentTransform

Transform MoreMountains.Feedbacks.MMF_InstantiateObject.PoolParentTransform

the transform the pool of objects will be parented to

◆ PositionMode

PositionModes MoreMountains.Feedbacks.MMF_InstantiateObject.PositionMode = PositionModes.FeedbackPosition

the chosen way to position the object

◆ PositionOffset

Vector3 MoreMountains.Feedbacks.MMF_InstantiateObject.PositionOffset

the position offset at which to instantiate the object

◆ RandomizedPositionMax

Vector3 MoreMountains.Feedbacks.MMF_InstantiateObject.RandomizedPositionMax = Vector3.one

the maximum value we'll randomize our position with

◆ RandomizedPositionMin

Vector3 MoreMountains.Feedbacks.MMF_InstantiateObject.RandomizedPositionMin = Vector3.zero

the minimum value we'll randomize our position with

◆ RandomizePosition

bool MoreMountains.Feedbacks.MMF_InstantiateObject.RandomizePosition = false

if this is true, instantiation position will be randomized between RandomizeMin and RandomizeMax

◆ TargetPosition

Vector3 MoreMountains.Feedbacks.MMF_InstantiateObject.TargetPosition

the transform at which to instantiate the object

◆ TargetTransform

Transform MoreMountains.Feedbacks.MMF_InstantiateObject.TargetTransform

the transform at which to instantiate the object


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