void CreateInstance(VFX vfx, Vector3 position, bool flip, Transform parent) { VFXInstancePool poolToUse = vfx.pool; var instance = poolToUse.Pop(); instance.expires = Time.time + vfx.lifetime; if (flip) { instance.transform.localScale = new Vector3(-1, 1, 1); } else { instance.transform.localScale = new Vector3(1, 1, 1); } instance.parent = parent; instance.SetPosition(position); m_RunningFx.Push(instance); }
void CreateInstance(VFX vfx, Vector4 position, bool flip, Transform parent, TileBase tileOverride) { if (tileOverride == null || !vfx.vfxOverrideDictionnary.TryGetValue(tileOverride, out VFXInstancePool poolToUse)) { poolToUse = vfx.pool; } var instance = poolToUse.Pop(); instance.expires = Time.time + vfx.lifetime; if (flip) { instance.transform.localScale = new Vector3(-1, 1, 1); } else { instance.transform.localScale = new Vector3(1, 1, 1); } instance.parent = parent; instance.SetPosition(position); m_RunningFx.Push(instance); }