コード例 #1
0
        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);
        }
コード例 #2
0
        void CreateInstance(VFX vfx, Vector4 position, bool flip, Transform parent, TileBase tileOverride)
        {
            VFXInstancePool poolToUse = null;

            if (tileOverride == null || !vfx.vfxOverrideDictionnary.TryGetValue(tileOverride, out 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);
        }