public GameObject CreateFxImmediate(GameObject pfb, Vector3 pos, Quaternion rot, VFX_TYPE vfxType) { if (null != pfb && Direction.IsForward(pos, cam.transform)) { return(Object.Instantiate((Object)pfb, pos, rot) as GameObject); } return(null); }
public GameObject CreateFx(GameObject pfb, Vector3 pos, Quaternion rot, VFX_TYPE vfxType) { if (deltaTimes == null || deltaTimes.Length == 0) { return(null); } if (null != pfb && cam != null && Direction.IsForward(pos, cam.transform) && deltaTimes[(int)vfxType] > deltaMax) { deltaTimes[(int)vfxType] = 0f; return(Object.Instantiate((Object)pfb, pos, rot) as GameObject); } return(null); }
// Main function that will be called by other scripts to create VFX effects public GameObject SpawnVFX(Vector3 position, Quaternion rotation, VFX_TYPE type) { switch (type) { case VFX_TYPE.SPARKS_TYPE1: return(SpawnSpark_Type1(position, rotation)); case VFX_TYPE.SPARKS_TYPE2: return(SpawnSpark_Type2(position, rotation)); case VFX_TYPE.SMOKE_TYPE1: return(SpawnSmoke_Type1(position, rotation)); case VFX_TYPE.DEBRIS: return(SpawnDebris(position, rotation)); case VFX_TYPE.EXPLOSION_TYPE1: return(SpawnExplosion_Type1(position, rotation)); case VFX_TYPE.EXPLOSIONSPARK_TYPE1: return(SpawnExplosionSpark_Type1(position, rotation)); case VFX_TYPE.DUSTCLOUD: return(SpawnDustCloud(position, rotation)); case VFX_TYPE.BULLETS: return(SpawnBulletsEffect(position, rotation)); case VFX_TYPE.BULLETS_LARGE: return(SpawnBulletsLargeEffect(position, rotation)); case VFX_TYPE.MUZZLEFLASH: return(SpawnMuzzleFlash(position, rotation)); case VFX_TYPE.MUZZLEFLASH_RAPID: return(SpawnMuzzleFlashRapid(position, rotation)); default: return(null); } }