Class VFXManager
Handles displaying VFX in the game. One instance should be in the scene, and is part of the Manager prefab. It will create pools of the VFX prefabs defined in the given VFXDatabase, and through the GetVFX/PlayVFX methods allows you to get an instance at a given position. The pools are rotating queue, so when you are finished with an instance, that instance will be moved to the back of the available instance queue.
Inheritance
Namespace: CreatorKitCode
Assembly: Assembly-CSharp.dll
Syntax
public class VFXManager : MonoBehaviour
Fields
Database
Declaration
public VFXDatabase Database
Field Value
Type | Description |
---|---|
VFXDatabase |
Methods
GetVFX(VFXType)
Return a VFXInstance of the given type. use instance.Effect to access the gameobject. It will be SetActive by the function, so you just have to place it.
Declaration
public static VFXManager.VFXInstance GetVFX(VFXType type)
Parameters
Type | Name | Description |
---|---|---|
VFXType | type | The type of VFX wanted. This enum will be generated by a tool in the Editor based on the VFXDatabase entries |
Returns
Type | Description |
---|---|
VFXManager.VFXInstance | The instance that was in front of the pool queue |
PlayVFX(VFXType, Vector3)
This is a shortcut, will get a VFX of the given type and will place it at the given position
Declaration
public static VFXManager.VFXInstance PlayVFX(VFXType type, Vector3 position)
Parameters
Type | Name | Description |
---|---|---|
VFXType | type | The type of VFX wanted. This enum will be generated by a tool in the Editor based on the VFXDatabase entries |
UnityEngine.Vector3 | position | Where the VFX will be placed |
Returns
Type | Description |
---|---|
VFXManager.VFXInstance | The Instance it just placed, can be useful if the effect isn't auto-disabled (e.g. looping effect) |