Magic Time for Projectile Factory
v1.0
Last updated
v1.0
Last updated
Install the Projectile Factory Magic Time Integration package after both Projectile Factory and Magic Time have been installed.
Add the MagicTimeProjectile
component to your Projectile objects. This class inherits from MagicTimeUser
and has all the methods that brings.
You can always create a new class which inherits from MagicTimeProjectile
if you'd like to add any custom logic for your project, including any interactions with custom Behaviors you may have created.
Each Projectile has a ProjectileData
object on it, which can be customized. This also has the "speed" value for the Projectile. The integration comes with MagicTimeProjectileData
which will calculate speed using the value set modified by the Magic Time values.
Create a new Projectile Data object of this type by right-clicking in your project and choosing Create/Projectile Factory/Projectile Data/Projectile Data for Magic Time
Be sure to set the values you'd like, and then populate your Projectiles with this Projectile Data object.
For "Damage over Time" projectiles, this will also override those, allowing you to perform damage over time instead of straight values, if you choose. The "over time" will be computed using the MagicTimeProjectile.CombinedTimeScale()
value.
Your Projectiles may have many different types of components on them -- they probably have a ParticleSystem
, but they may also have audio, lighting, or other systems. You can add additional components to your Projectile object which handle the time / speed management of these various components.
The original DestroyOrPoolObject
component will send an object back to the pool after a set amount of time. The new version, MagicTimeUserDestroyOrPoolObject
will do the same thing, but will take into account the objects TimeScale
, so that it doesn't get destroyed too soon.
The MagicTimeParticleSystem
component will gather all ParticleSystems
that are on this Projectile, and set their simulation speed to match the CombinedValue()
of the GameTimeUser
object. This way as the object speeds up and slows down, the particle system effects will as well.
These components below will connect to the MagicTimeUser
component on the MagicTimeUserParticleSystem
, and use the time values from that. They can also be used outside of this, with any MagicTimeUser
component.
Add the MagicTimeUserTrailRenderer
component to handle any TrailRenderer
components on the projectile.
Add the MagicTimeUserAudioSource
component to automatically adjust the pitch of audio clips on the Audio Source. This will cache the starting pitch values, so should really be used only for Audio Sources that do not have dynamic clips.
There is also a MagicTimeUserAudioMixer
component, which you can add on your Audio Mixer, and assign the MagicTimeUser
value to the user you'd like. Generally this would NOT be a single projectile!