Feel
4.3
The best way to improve your game's feel and make it extra juicy
|
This class will let you pool, recycle and spawn floating texts, usually to show damage info. It requires as input a MMFloatingText object. More...
Public Types | |
enum | PoolerModes { PoolerModes.Simple, PoolerModes.Multiple } |
whether to spawn a single prefab or one at random More... | |
enum | AlignmentModes { AlignmentModes.Fixed, AlignmentModes.MatchInitialDirection, AlignmentModes.MatchMovementDirection } |
whether the spawned text should have a fixed alignment, orient to match the initial spawn direction, or its movement curve More... | |
Public Member Functions | |
virtual void | OnMMFloatingTextSpawnEvent (MMChannelData channelData, Vector3 spawnPosition, string value, Vector3 direction, float intensity, bool forceLifetime=false, float lifetime=1f, bool forceColor=false, Gradient animateColorGradient=null, bool useUnscaledTime=false) |
When we get a floating text event on this spawner's Channel, we spawn a new floating text More... | |
Public Attributes | |
MMChannelModes | ChannelMode = MMChannelModes.Int |
int | Channel = 0 |
the channel to listen to - has to match the one on the feedback More... | |
MMChannel | MMChannelDefinition = null |
bool | CanSpawn = true |
whether or not this spawner can spawn at this time More... | |
bool | UseUnscaledTime = false |
whether or not this spawner should spawn objects on unscaled time More... | |
PoolerModes | PoolerMode = PoolerModes.Simple |
the selected pooler mode (single prefab or multiple ones) More... | |
MMFloatingText | PooledSimpleMMFloatingText |
the prefab to spawn (ignored if in multiple mode) More... | |
List< MMFloatingText > | PooledMultipleMMFloatingText |
the prefabs to spawn (ignored if in simple mode) More... | |
int | PoolSize = 20 |
the amount of objects to pool to avoid having to instantiate them at runtime. Should be bigger than the max amount of texts you plan on having on screen at any given moment More... | |
bool | NestWaitingPool = true |
whether or not to nest the waiting pools More... | |
bool | MutualizeWaitingPools = true |
whether or not to mutualize the waiting pools More... | |
bool | PoolCanExpand = true |
whether or not the text pool can expand if the pool is empty More... | |
Vector2 | Lifetime = Vector2.one |
the random min and max lifetime duration for the spawned texts (in seconds) More... | |
Vector3 | SpawnOffsetMin = Vector3.zero |
the random min position at which to spawn the text, relative to its intended spawn position More... | |
Vector3 | SpawnOffsetMax = Vector3.zero |
the random max position at which to spawn the text, relative to its intended spawn position More... | |
bool | AnimateMovement = true |
whether or not to animate the movement of spawned texts More... | |
bool | AnimateX = false |
whether or not to animate the X movement of spawned texts More... | |
Vector2 | RemapXZero = Vector2.zero |
the value to which the x movement curve's zero should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness More... | |
Vector2 | RemapXOne = Vector2.one |
the value to which the x movement curve's one should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness More... | |
AnimationCurve | AnimateXCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f)) |
the curve on which to animate the x movement More... | |
bool | AnimateY = true |
whether or not to animate the Y movement of spawned texts More... | |
Vector2 | RemapYZero = Vector2.zero |
the value to which the y movement curve's zero should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness More... | |
Vector2 | RemapYOne = new Vector2(5f, 5f) |
the value to which the y movement curve's one should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness More... | |
AnimationCurve | AnimateYCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f)) |
the curve on which to animate the y movement More... | |
bool | AnimateZ = false |
whether or not to animate the Z movement of spawned texts More... | |
Vector2 | RemapZZero = Vector2.zero |
the value to which the z movement curve's zero should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness More... | |
Vector2 | RemapZOne = Vector2.one |
the value to which the z movement curve's one should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness More... | |
AnimationCurve | AnimateZCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f)) |
the curve on which to animate the z movement More... | |
AlignmentModes | AlignmentMode = AlignmentModes.Fixed |
the selected alignment mode (whether the spawned text should have a fixed alignment, orient to match the initial spawn direction, or its movement curve) More... | |
Vector3 | FixedAlignment = Vector3.up |
when in fixed mode, the direction in which to keep the spawned texts More... | |
bool | AlwaysFaceCamera |
whether or not spawned texts should always face the camera More... | |
bool | AutoGrabMainCameraOnStart = true |
whether or not this spawner should automatically grab the main camera on start More... | |
Camera | TargetCamera |
if not in auto grab mode, the camera to use for billboards More... | |
bool | AnimateScale = true |
whether or not to animate the scale of spawned texts More... | |
Vector2 | RemapScaleZero = Vector2.zero |
the value to which the scale curve's zero should be remapped to More... | |
Vector2 | RemapScaleOne = Vector2.one |
the value to which the scale curve's one should be remapped to More... | |
AnimationCurve | AnimateScaleCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.15f, 1f), new Keyframe(0.85f, 1f), new Keyframe(1f, 0f)) |
the curve on which to animate the scale More... | |
bool | AnimateColor = false |
whether or not to animate the spawned text's color over time More... | |
Gradient | AnimateColorGradient = new Gradient() |
the gradient over which to animate the spawned text's color over time More... | |
bool | AnimateOpacity = true |
whether or not to animate the opacity of the spawned texts More... | |
Vector2 | RemapOpacityZero = Vector2.zero |
the value to which the opacity curve's zero should be remapped to More... | |
Vector2 | RemapOpacityOne = Vector2.one |
the value to which the opacity curve's one should be remapped to More... | |
AnimationCurve | AnimateOpacityCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.2f, 1f), new Keyframe(0.8f, 1f), new Keyframe(1f, 0f)) |
the curve on which to animate the opacity More... | |
bool | IntensityImpactsLifetime = false |
whether or not the intensity multiplier should impact lifetime More... | |
float | IntensityLifetimeMultiplier = 1f |
when getting an intensity multiplier, the value by which to multiply the lifetime More... | |
bool | IntensityImpactsMovement = false |
whether or not the intensity multiplier should impact movement More... | |
float | IntensityMovementMultiplier = 1f |
when getting an intensity multiplier, the value by which to multiply the movement values More... | |
bool | IntensityImpactsScale = false |
whether or not the intensity multiplier should impact scale More... | |
float | IntensityScaleMultiplier = 1f |
when getting an intensity multiplier, the value by which to multiply the scale values More... | |
Vector2Int | DebugRandomValue = new Vector2Int(100, 500) |
a random value to display when pressing the TestSpawnOne button More... | |
Vector2 | DebugInterval = new Vector2(0.3f, 0.5f) |
the min and max bounds within which to pick a value to output when pressing the TestSpawnMany button More... | |
bool | TestSpawnOneBtn |
a button used to test the spawn of one text More... | |
bool | TestSpawnManyBtn |
a button used to start/stop the spawn of texts at regular intervals More... | |
Protected Member Functions | |
virtual void | Awake () |
On awake we initialize our spawner More... | |
virtual void | Start () |
On Start we grab our main camera if needed More... | |
virtual void | Initialization () |
On init, we instantiate our object pool and grab the main camera More... | |
virtual void | InstantiateObjectPool () |
Instantiates the specified type of object pool More... | |
virtual void | InstantiateSimplePool () |
Instantiates a simple object pooler and sets it up More... | |
virtual void | InstantiateMultiplePool () |
Instantiates a multiple object pooler and sets it up More... | |
virtual void | GrabMainCamera () |
Grabs the main camera if needed More... | |
virtual void | Spawn (string value, Vector3 position, Vector3 direction, float intensity=1f, bool forceLifetime=false, float lifetime=1f, bool forceColor=false, Gradient animateColorGradient=null) |
Spawns a new floating text More... | |
virtual void | OnEnable () |
On enable we start listening for floating text events More... | |
virtual void | OnDisable () |
On disable we stop listening for floating text events More... | |
virtual void | TestSpawnOne () |
A test method that spawns one floating text More... | |
virtual void | TestSpawnMany () |
A method used to start/stop the regular spawning of debug floating texts More... | |
virtual IEnumerator | TestSpawnManyCo () |
A coroutine used to spawn debug floating texts until stopped More... | |
Protected Attributes | |
MMObjectPooler | _pooler |
MMFloatingText | _floatingText |
Coroutine | _testSpawnCoroutine |
float | _lifetime |
float | _speed |
Vector3 | _spawnOffset |
Vector3 | _direction |
Gradient | _colorGradient |
bool | _animateColor |
This class will let you pool, recycle and spawn floating texts, usually to show damage info. It requires as input a MMFloatingText object.
|
protectedvirtual |
On awake we initialize our spawner
|
protectedvirtual |
Grabs the main camera if needed
|
protectedvirtual |
On init, we instantiate our object pool and grab the main camera
|
protectedvirtual |
Instantiates a multiple object pooler and sets it up
|
protectedvirtual |
Instantiates the specified type of object pool
|
protectedvirtual |
Instantiates a simple object pooler and sets it up
|
protectedvirtual |
On disable we stop listening for floating text events
|
protectedvirtual |
On enable we start listening for floating text events
|
virtual |
When we get a floating text event on this spawner's Channel, we spawn a new floating text
channel | |
spawnPosition | |
value | |
direction | |
intensity | |
forceLifetime | |
lifetime | |
forceColor | |
animateColorGradient |
|
protectedvirtual |
Spawns a new floating text
value | |
position | |
direction | |
intensity | |
forceLifetime | |
lifetime | |
forceColor | |
animateColorGradient |
|
protectedvirtual |
On Start we grab our main camera if needed
|
protectedvirtual |
A method used to start/stop the regular spawning of debug floating texts
|
protectedvirtual |
A coroutine used to spawn debug floating texts until stopped
|
protectedvirtual |
A test method that spawns one floating text
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
AlignmentModes MoreMountains.Feedbacks.MMFloatingTextSpawner.AlignmentMode = AlignmentModes.Fixed |
the selected alignment mode (whether the spawned text should have a fixed alignment, orient to match the initial spawn direction, or its movement curve)
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AlwaysFaceCamera |
whether or not spawned texts should always face the camera
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateColor = false |
whether or not to animate the spawned text's color over time
Gradient MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateColorGradient = new Gradient() |
the gradient over which to animate the spawned text's color over time
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateMovement = true |
whether or not to animate the movement of spawned texts
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateOpacity = true |
whether or not to animate the opacity of the spawned texts
AnimationCurve MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateOpacityCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.2f, 1f), new Keyframe(0.8f, 1f), new Keyframe(1f, 0f)) |
the curve on which to animate the opacity
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateScale = true |
whether or not to animate the scale of spawned texts
AnimationCurve MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateScaleCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(0.15f, 1f), new Keyframe(0.85f, 1f), new Keyframe(1f, 0f)) |
the curve on which to animate the scale
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateX = false |
whether or not to animate the X movement of spawned texts
AnimationCurve MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateXCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f)) |
the curve on which to animate the x movement
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateY = true |
whether or not to animate the Y movement of spawned texts
AnimationCurve MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateYCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f)) |
the curve on which to animate the y movement
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateZ = false |
whether or not to animate the Z movement of spawned texts
AnimationCurve MoreMountains.Feedbacks.MMFloatingTextSpawner.AnimateZCurve = new AnimationCurve(new Keyframe(0f, 0f), new Keyframe(1f, 1f)) |
the curve on which to animate the z movement
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.AutoGrabMainCameraOnStart = true |
whether or not this spawner should automatically grab the main camera on start
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.CanSpawn = true |
whether or not this spawner can spawn at this time
int MoreMountains.Feedbacks.MMFloatingTextSpawner.Channel = 0 |
the channel to listen to - has to match the one on the feedback
MMChannelModes MoreMountains.Feedbacks.MMFloatingTextSpawner.ChannelMode = MMChannelModes.Int |
whether to listen on a channel defined by an int or by a MMChannel scriptable object. Ints are simple to setup but can get messy and make it harder to remember what int corresponds to what. MMChannel scriptable objects require you to create them in advance, but come with a readable name and are more scalable
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.DebugInterval = new Vector2(0.3f, 0.5f) |
the min and max bounds within which to pick a value to output when pressing the TestSpawnMany button
Vector2Int MoreMountains.Feedbacks.MMFloatingTextSpawner.DebugRandomValue = new Vector2Int(100, 500) |
a random value to display when pressing the TestSpawnOne button
Vector3 MoreMountains.Feedbacks.MMFloatingTextSpawner.FixedAlignment = Vector3.up |
when in fixed mode, the direction in which to keep the spawned texts
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.IntensityImpactsLifetime = false |
whether or not the intensity multiplier should impact lifetime
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.IntensityImpactsMovement = false |
whether or not the intensity multiplier should impact movement
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.IntensityImpactsScale = false |
whether or not the intensity multiplier should impact scale
float MoreMountains.Feedbacks.MMFloatingTextSpawner.IntensityLifetimeMultiplier = 1f |
when getting an intensity multiplier, the value by which to multiply the lifetime
float MoreMountains.Feedbacks.MMFloatingTextSpawner.IntensityMovementMultiplier = 1f |
when getting an intensity multiplier, the value by which to multiply the movement values
float MoreMountains.Feedbacks.MMFloatingTextSpawner.IntensityScaleMultiplier = 1f |
when getting an intensity multiplier, the value by which to multiply the scale values
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.Lifetime = Vector2.one |
the random min and max lifetime duration for the spawned texts (in seconds)
MMChannel MoreMountains.Feedbacks.MMFloatingTextSpawner.MMChannelDefinition = null |
the MMChannel definition asset to use to listen for events. The feedbacks targeting this shaker will have to reference that same MMChannel definition to receive events - to create a MMChannel, right click anywhere in your project (usually in a Data folder) and go MoreMountains > MMChannel, then name it with some unique name
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.MutualizeWaitingPools = true |
whether or not to mutualize the waiting pools
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.NestWaitingPool = true |
whether or not to nest the waiting pools
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.PoolCanExpand = true |
whether or not the text pool can expand if the pool is empty
List<MMFloatingText> MoreMountains.Feedbacks.MMFloatingTextSpawner.PooledMultipleMMFloatingText |
the prefabs to spawn (ignored if in simple mode)
MMFloatingText MoreMountains.Feedbacks.MMFloatingTextSpawner.PooledSimpleMMFloatingText |
the prefab to spawn (ignored if in multiple mode)
PoolerModes MoreMountains.Feedbacks.MMFloatingTextSpawner.PoolerMode = PoolerModes.Simple |
the selected pooler mode (single prefab or multiple ones)
int MoreMountains.Feedbacks.MMFloatingTextSpawner.PoolSize = 20 |
the amount of objects to pool to avoid having to instantiate them at runtime. Should be bigger than the max amount of texts you plan on having on screen at any given moment
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapOpacityOne = Vector2.one |
the value to which the opacity curve's one should be remapped to
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapOpacityZero = Vector2.zero |
the value to which the opacity curve's zero should be remapped to
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapScaleOne = Vector2.one |
the value to which the scale curve's one should be remapped to
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapScaleZero = Vector2.zero |
the value to which the scale curve's zero should be remapped to
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapXOne = Vector2.one |
the value to which the x movement curve's one should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapXZero = Vector2.zero |
the value to which the x movement curve's zero should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapYOne = new Vector2(5f, 5f) |
the value to which the y movement curve's one should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapYZero = Vector2.zero |
the value to which the y movement curve's zero should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapZOne = Vector2.one |
the value to which the z movement curve's one should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness
Vector2 MoreMountains.Feedbacks.MMFloatingTextSpawner.RemapZZero = Vector2.zero |
the value to which the z movement curve's zero should be remapped to, randomized between its min and max - put the same value in both min and max if you don't want any randomness
Vector3 MoreMountains.Feedbacks.MMFloatingTextSpawner.SpawnOffsetMax = Vector3.zero |
the random max position at which to spawn the text, relative to its intended spawn position
Vector3 MoreMountains.Feedbacks.MMFloatingTextSpawner.SpawnOffsetMin = Vector3.zero |
the random min position at which to spawn the text, relative to its intended spawn position
Camera MoreMountains.Feedbacks.MMFloatingTextSpawner.TargetCamera |
if not in auto grab mode, the camera to use for billboards
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.TestSpawnManyBtn |
a button used to start/stop the spawn of texts at regular intervals
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.TestSpawnOneBtn |
a button used to test the spawn of one text
bool MoreMountains.Feedbacks.MMFloatingTextSpawner.UseUnscaledTime = false |
whether or not this spawner should spawn objects on unscaled time