浏览代码

修改bug

DESKTOP-FB72PO8\Administrator 6 天之前
父节点
当前提交
b748963622

+ 0 - 8
Assets/ParticleEffectForUGUI.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: DSsasCL+VH0SMGB/OFh0QOLQDkehIMhiXofDpTMHJKrR4YMMy0dHR84=
-folderAsset: yes
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 8
Assets/ParticleEffectForUGUI/Scripts.meta

@@ -1,8 +0,0 @@
-fileFormatVersion: 2
-guid: Wnke4yOsUXOo+02GYQvzC0t5WiR1zyGj2jBKe5TnBhWpw+YXsTWuqMo=
-folderAsset: yes
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 65
Assets/ParticleEffectForUGUI/Scripts/AnimatableProperty.cs

@@ -1,65 +0,0 @@
-using UnityEngine;
-
-namespace Coffee.UIExtensions
-{
-    [System.Serializable]
-    public class AnimatableProperty : ISerializationCallbackReceiver
-    {
-        public enum ShaderPropertyType
-        {
-            Color,
-            Vector,
-            Float,
-            Range,
-            Texture,
-        }
-
-        [SerializeField] string m_Name = "";
-        [SerializeField] ShaderPropertyType m_Type = ShaderPropertyType.Vector;
-        public int id { get; private set; }
-
-        public ShaderPropertyType type
-        {
-            get { return m_Type; }
-        }
-
-        public void UpdateMaterialProperties(Material material, MaterialPropertyBlock mpb)
-        {
-            if (!material.HasProperty(id)) return;
-
-            switch (type)
-            {
-                case ShaderPropertyType.Color:
-                    var color = mpb.GetColor(id);
-                    if (color != default(Color))
-                        material.SetColor(id, color);
-                    break;
-                case ShaderPropertyType.Vector:
-                    var vector = mpb.GetVector(id);
-                    if (vector != default(Vector4))
-                        material.SetVector(id, vector);
-                    break;
-                case ShaderPropertyType.Float:
-                case ShaderPropertyType.Range:
-                    var value = mpb.GetFloat(id);
-                    if (value != default(float))
-                        material.SetFloat(id, value);
-                    break;
-                case ShaderPropertyType.Texture:
-                    var tex = mpb.GetTexture(id);
-                    if (tex != default(Texture))
-                        material.SetTexture(id, tex);
-                    break;
-            }
-        }
-
-        public void OnBeforeSerialize()
-        {
-        }
-
-        public void OnAfterDeserialize()
-        {
-            id = Shader.PropertyToID(m_Name);
-        }
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/AnimatableProperty.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: Xnwb4H//BS8wIDm5HCuoqLatrqkYiFQYBudrryYVPct8WkM9Nv1Jdss=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 97
Assets/ParticleEffectForUGUI/Scripts/BakingCamera.cs

@@ -1,97 +0,0 @@
-using UnityEngine;
-
-namespace Coffee.UIParticleExtensions
-{
-    [AddComponentMenu("")]
-    internal class BakingCamera : MonoBehaviour
-    {
-        static BakingCamera s_Instance;
-        private static readonly Vector3 s_OrthoPosition = new Vector3(0, 0, -1000);
-        private static readonly Quaternion s_OrthoRotation = Quaternion.identity;
-
-#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
-        // static BakingCamera s_InstanceForPrefab;
-        //
-        // private static BakingCamera InstanceForPrefab
-        // {
-        //     get
-        //     {
-        //         // If current scene is prefab mode, create OverlayCamera for editor.
-        //         var prefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
-        //         if (prefabStage == null || !prefabStage.scene.isLoaded) return null;
-        //         if (s_InstanceForPrefab) return s_InstanceForPrefab;
-        //
-        //         s_InstanceForPrefab = Create();
-        //         s_InstanceForPrefab.name += " (For Prefab Stage)";
-        //         UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene(s_InstanceForPrefab.gameObject, prefabStage.scene);
-        //
-        //         return s_InstanceForPrefab;
-        //     }
-        // }
-#endif
-
-        private static BakingCamera Instance
-        {
-            get
-            {
-// #if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
-//                 var inst = InstanceForPrefab;
-//                 if (inst) return inst;
-// #endif
-                // Find instance in scene, or create new one.
-                return s_Instance
-                    ? s_Instance
-                    : (s_Instance = Create());
-            }
-        }
-
-        private Camera _camera;
-
-        private static BakingCamera Create()
-        {
-            var gameObject = new GameObject(typeof(BakingCamera).Name);
-
-            // This camera object is just for internal use
-            gameObject.hideFlags = HideFlags.HideAndDontSave;
-
-            var inst = gameObject.AddComponent<BakingCamera>();
-            inst._camera = gameObject.AddComponent<Camera>();
-            inst._camera.enabled = false;
-            inst._camera.orthographic = true;
-
-            // Turn camera off because particle mesh baker will use only camera matrix
-            gameObject.SetActive(false);
-
-            return inst;
-        }
-
-        private void Awake()
-        {
-            if (this == s_Instance)
-                DontDestroyOnLoad(gameObject);
-        }
-
-        public static Camera GetCamera(Canvas canvas)
-        {
-            if (!canvas) return Camera.main;
-
-            canvas = canvas.rootCanvas;
-            // Adjust camera orthographic size to canvas size
-            // for canvas-based coordinates of particles' size and speed.
-            var size = ((RectTransform) canvas.transform).rect.size;
-            Instance._camera.orthographicSize = Mathf.Max(size.x, size.y) * canvas.scaleFactor;
-
-            var camera = canvas.worldCamera;
-            var transform = Instance.transform;
-            var rotation = canvas.renderMode != RenderMode.ScreenSpaceOverlay && camera
-                ? camera.transform.rotation
-                : s_OrthoRotation;
-
-            transform.SetPositionAndRotation(s_OrthoPosition, rotation);
-            Instance._camera.orthographic = true;
-            Instance._camera.farClipPlane = 2000f;
-
-            return Instance._camera;
-        }
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/BakingCamera.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: WXpN5iKoUX9BL5S9Jw89UAzIENv677Mn1Iqda22v23POENJfcH2JDZA=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 63
Assets/ParticleEffectForUGUI/Scripts/CombineInstanceEx.cs

@@ -1,63 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace Coffee.UIParticleExtensions
-{
-    internal class CombineInstanceEx
-    {
-        private int count;
-        public long hash = -1;
-        public int index = -1;
-        private readonly List<CombineInstance> combineInstances = new List<CombineInstance>(32);
-        public Mesh mesh;
-        public Matrix4x4 transform;
-
-        public void Combine()
-        {
-            switch (count)
-            {
-                case 0:
-                    return;
-                case 1:
-                    mesh = combineInstances[0].mesh;
-                    transform = combineInstances[0].transform;
-                    return;
-                default:
-                {
-                    var cis = CombineInstanceArrayPool.Get(combineInstances);
-                    mesh = MeshPool.Rent();
-                    mesh.CombineMeshes(cis, true, true);
-                    transform = Matrix4x4.identity;
-                    cis.Clear();
-                    return;
-                }
-            }
-        }
-
-        public void Clear()
-        {
-            for (var i = 0; i < combineInstances.Count; i++)
-            {
-                var inst = combineInstances[i];
-                MeshPool.Return(inst.mesh);
-                inst.mesh = null;
-                combineInstances[i] = inst;
-            }
-
-            combineInstances.Clear();
-
-            MeshPool.Return(mesh);
-            mesh = null;
-
-            count = 0;
-            hash = -1;
-            index = -1;
-        }
-
-        public void Push(Mesh mesh, Matrix4x4 transform)
-        {
-            combineInstances.Add(new CombineInstance {mesh = mesh, transform = transform});
-            count++;
-        }
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/CombineInstanceEx.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: Xn0dtX+tW3vAVJfk3iKd1a/PCLwDhEN12YcSKIIDKTiOboDdEg6JQGI=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 106
Assets/ParticleEffectForUGUI/Scripts/MeshHelper.cs

@@ -1,106 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-using UnityEngine.Profiling;
-
-namespace Coffee.UIParticleExtensions
-{
-    internal static class MeshHelper
-    {
-        public static List<bool> activeMeshIndices { get; private set; }
-        private static readonly List<CombineInstanceEx> s_CachedInstance;
-        private static int count;
-
-        public static void Init()
-        {
-            activeMeshIndices = new List<bool>();
-        }
-
-        static MeshHelper()
-        {
-            s_CachedInstance = new List<CombineInstanceEx>(8);
-            for (var i = 0; i < 8; i++)
-            {
-                s_CachedInstance.Add(new CombineInstanceEx());
-            }
-        }
-
-        private static CombineInstanceEx Get(int index, long hash)
-        {
-            if (0 < count && s_CachedInstance[count - 1].hash == hash)
-                return s_CachedInstance[count - 1];
-
-            if (s_CachedInstance.Count <= count)
-            {
-                var newInst = new CombineInstanceEx();
-                s_CachedInstance.Add(newInst);
-            }
-
-            var inst = s_CachedInstance[count];
-            inst.hash = hash;
-            if (inst.index != -1) return inst;
-
-            inst.index = index;
-            count++;
-            return inst;
-        }
-
-        public static Mesh GetTemporaryMesh()
-        {
-            return MeshPool.Rent();
-        }
-
-        public static void Push(int index, long hash, Mesh mesh, Matrix4x4 transform)
-        {
-            if (mesh.vertexCount <= 0)
-            {
-                DiscardTemporaryMesh(mesh);
-                return;
-            }
-
-            Profiler.BeginSample("[UIParticle] MeshHelper > Get CombineInstanceEx");
-            var inst = Get(index, hash);
-            Profiler.EndSample();
-
-            Profiler.BeginSample("[UIParticle] MeshHelper > Push To Mesh Helper");
-            inst.Push(mesh, transform);
-            Profiler.EndSample();
-
-            activeMeshIndices[inst.index] = true;
-        }
-
-        public static void Clear()
-        {
-            count = 0;
-            activeMeshIndices.Clear();
-            foreach (var inst in s_CachedInstance)
-            {
-                inst.Clear();
-            }
-        }
-
-        public static void CombineMesh(Mesh result)
-        {
-            if (count == 0) return;
-
-            for (var i = 0; i < count; i++)
-            {
-                Profiler.BeginSample("[UIParticle] MeshHelper > Combine Mesh Internal");
-                s_CachedInstance[i].Combine();
-                Profiler.EndSample();
-            }
-
-            Profiler.BeginSample("[UIParticle] MeshHelper > Combine Mesh");
-            var cis = CombineInstanceArrayPool.Get(s_CachedInstance, count);
-            result.CombineMeshes(cis, false, true);
-            cis.Clear();
-            Profiler.EndSample();
-
-            result.RecalculateBounds();
-        }
-
-        public static void DiscardTemporaryMesh(Mesh mesh)
-        {
-            MeshPool.Return(mesh);
-        }
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/MeshHelper.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: Ci8d53+qAH21ljDcT42NvTJx5zivUrwyi339uL8AKAT23DdLvCrOaUg=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 74
Assets/ParticleEffectForUGUI/Scripts/ModifiedMaterial.cs

@@ -1,74 +0,0 @@
-using System.Collections.Generic;
-using UnityEngine;
-
-namespace Coffee.UIParticleExtensions
-{
-    internal class ModifiedMaterial
-    {
-        private static readonly List<MatEntry> s_Entries = new List<MatEntry>();
-
-        public static Material Add(Material baseMat, Texture texture, int id)
-        {
-            MatEntry e;
-            for (var i = 0; i < s_Entries.Count; ++i)
-            {
-                e = s_Entries[i];
-                if (e.baseMat != baseMat || e.texture != texture || e.id != id) continue;
-                ++e.count;
-                return e.customMat;
-            }
-
-            e = new MatEntry();
-            e.count = 1;
-            e.baseMat = baseMat;
-            e.texture = texture;
-            e.id = id;
-            e.customMat = new Material(baseMat);
-            e.customMat.hideFlags = HideFlags.HideAndDontSave;
-            if (texture)
-                e.customMat.mainTexture = texture;
-            s_Entries.Add(e);
-            // Debug.LogFormat(">>>> ModifiedMaterial.Add -> count = {0} {1} {2} {3}", s_Entries.Count, baseMat, texture, id);
-            return e.customMat;
-        }
-
-        public static void Remove(Material customMat)
-        {
-            if (!customMat) return;
-
-            for (var i = 0; i < s_Entries.Count; ++i)
-            {
-                var e = s_Entries[i];
-                if (e.customMat != customMat) continue;
-                if (--e.count == 0)
-                {
-                    // Debug.LogFormat(">>>> ModifiedMaterial.Add -> count = {0} {1} {2} {3}", s_Entries.Count - 1, e.customMat, e.texture, e.id);
-                    DestroyImmediate(e.customMat);
-                    e.baseMat = null;
-                    e.texture = null;
-                    s_Entries.RemoveAt(i);
-                }
-
-                break;
-            }
-        }
-
-        private static void DestroyImmediate(Object obj)
-        {
-            if (!obj) return;
-            if (Application.isEditor)
-                Object.DestroyImmediate(obj);
-            else
-                Object.Destroy(obj);
-        }
-
-        private class MatEntry
-        {
-            public Material baseMat;
-            public Material customMat;
-            public int count;
-            public Texture texture;
-            public int id;
-        }
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/ModifiedMaterial.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: CHtKtXikAHyaGPIxQZR9gdGMpHO1qAdRQVvEhwWqRG9iQQTx2zkd11U=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 524
Assets/ParticleEffectForUGUI/Scripts/UIParticle.cs

@@ -1,524 +0,0 @@
-#if UNITY_2019_3_11 || UNITY_2019_3_12 || UNITY_2019_3_13 || UNITY_2019_3_14 || UNITY_2019_3_15 || UNITY_2019_4_OR_NEWER
-#define SERIALIZE_FIELD_MASKABLE
-#endif
-using System.Collections;
-using System.Collections.Generic;
-using System.Runtime.CompilerServices;
-using Coffee.UIParticleExtensions;
-using UnityEngine;
-using UnityEngine.Rendering;
-using UnityEngine.Serialization;
-using UnityEngine.UI;
-
-[assembly: InternalsVisibleTo("Fort23.Editor")]
-
-namespace Coffee.UIExtensions
-{
-    /// <summary>
-    /// Render maskable and sortable particle effect ,without Camera, RenderTexture or Canvas.
-    /// </summary>
-    [ExecuteInEditMode]
-    [RequireComponent(typeof(RectTransform))]
-    [RequireComponent(typeof(CanvasRenderer))]
-    public class UIParticle : MaskableGraphic
-#if UNITY_EDITOR
-        , ISerializationCallbackReceiver
-#endif
-    {
-        [HideInInspector] [SerializeField] internal bool m_IsTrail = false;
-
-        [Tooltip("Ignore canvas scaler")] [SerializeField] [FormerlySerializedAs("m_IgnoreParent")]
-        bool m_IgnoreCanvasScaler = true;
-
-        [Tooltip("Particle effect scale")] [SerializeField]
-        float m_Scale = 100;
-
-        [Tooltip("Particle effect scale")] [SerializeField]
-        private Vector3 m_Scale3D;
-
-        [Tooltip("Animatable material properties. If you want to change the material properties of the ParticleSystem in Animation, enable it.")] [SerializeField]
-        internal AnimatableProperty[] m_AnimatableProperties = new AnimatableProperty[0];
-
-        [Tooltip("Particles")] [SerializeField]
-        private List<ParticleSystem> m_Particles = new List<ParticleSystem>();
-
-        [Tooltip("Shrink rendering by material on refresh.\nNOTE: Performance will be improved, but in some cases the rendering is not correct.")] [SerializeField]
-        bool m_ShrinkByMaterial = false;
-
-#if !SERIALIZE_FIELD_MASKABLE
-        [SerializeField] private bool m_Maskable = true;
-#endif
-
-        private bool _shouldBeRemoved;
-        private DrivenRectTransformTracker _tracker;
-        private Mesh _bakedMesh;
-        private readonly List<Material> _modifiedMaterials = new List<Material>();
-        private readonly List<Material> _maskMaterials = new List<Material>();
-        private readonly List<bool> _activeMeshIndices = new List<bool>();
-        private Vector3 _cachedPosition;
-        private static readonly List<Material> s_TempMaterials = new List<Material>(2);
-        private static MaterialPropertyBlock s_Mpb;
-        private static readonly List<Material> s_PrevMaskMaterials = new List<Material>();
-        private static readonly List<Material> s_PrevModifiedMaterials = new List<Material>();
-        private static readonly List<Component> s_Components = new List<Component>();
-        private static readonly List<ParticleSystem> s_ParticleSystems = new List<ParticleSystem>();
-
-
-        /// <summary>
-        /// Should this graphic be considered a target for raycasting?
-        /// </summary>
-        public override bool raycastTarget
-        {
-            get { return false; }
-            set { }
-        }
-
-        public bool ignoreCanvasScaler
-        {
-            get { return m_IgnoreCanvasScaler; }
-            set
-            {
-                // if (m_IgnoreCanvasScaler == value) return;
-                m_IgnoreCanvasScaler = value;
-                _tracker.Clear();
-                if (isActiveAndEnabled && m_IgnoreCanvasScaler)
-                    _tracker.Add(this, rectTransform, DrivenTransformProperties.Scale);
-            }
-        }
-
-        public bool shrinkByMaterial
-        {
-            get { return m_ShrinkByMaterial; }
-            set
-            {
-                if (m_ShrinkByMaterial == value) return;
-                m_ShrinkByMaterial = value;
-                RefreshParticles();
-            }
-        }
-
-        /// <summary>
-        /// Particle effect scale.
-        /// </summary>
-        public float scale
-        {
-            get { return m_Scale3D.x; }
-            set
-            {
-                m_Scale = Mathf.Max(0.001f, value);
-                m_Scale3D = new Vector3(m_Scale, m_Scale, m_Scale);
-            }
-        }
-
-        /// <summary>
-        /// Particle effect scale.
-        /// </summary>
-        public Vector3 scale3D
-        {
-            get { return m_Scale3D; }
-            set
-            {
-                if (m_Scale3D == value) return;
-                m_Scale3D.x = Mathf.Max(0.001f, value.x);
-                m_Scale3D.y = Mathf.Max(0.001f, value.y);
-                m_Scale3D.z = Mathf.Max(0.001f, value.z);
-            }
-        }
-
-        internal Mesh bakedMesh
-        {
-            get { return _bakedMesh; }
-        }
-
-        public List<ParticleSystem> particles
-        {
-            get { return m_Particles; }
-        }
-
-        public IEnumerable<Material> materials
-        {
-            get { return _modifiedMaterials; }
-        }
-
-        public override Material materialForRendering
-        {
-            get { return canvasRenderer.GetMaterial(0); }
-        }
-
-        public List<bool> activeMeshIndices
-        {
-            get { return _activeMeshIndices; }
-            set
-            {
-                if (_activeMeshIndices.SequenceEqualFast(value)) return;
-                _activeMeshIndices.Clear();
-                _activeMeshIndices.AddRange(value);
-                UpdateMaterial();
-            }
-        }
-
-        internal Vector3 cachedPosition
-        {
-            get { return _cachedPosition; }
-            set { _cachedPosition = value; }
-        }
-
-        public void Play()
-        {
-            particles.Exec(p => p.Play());
-        }
-
-        public void Pause()
-        {
-            particles.Exec(p => p.Pause());
-        }
-
-        public void Stop()
-        {
-            particles.Exec(p => p.Stop());
-        }
-
-        public void Clear()
-        {
-            particles.Exec(p => p.Clear());
-        }
-
-        public void SetParticleSystemInstance(GameObject instance)
-        {
-            SetParticleSystemInstance(instance, true);
-        }
-
-        public void SetParticleSystemInstance(GameObject instance, bool destroyOldParticles)
-        {
-            if (!instance) return;
-
-            foreach (Transform child in transform)
-            {
-                var go = child.gameObject;
-                go.SetActive(false);
-                if (!destroyOldParticles) continue;
-
-#if UNITY_EDITOR
-                if (!Application.isPlaying)
-                    DestroyImmediate(go);
-                else
-#endif
-                    Destroy(go);
-            }
-
-            var tr = instance.transform;
-            tr.SetParent(transform, false);
-            tr.localPosition = Vector3.zero;
-
-            RefreshParticles(instance);
-        }
-
-        public void SetParticleSystemPrefab(GameObject prefab)
-        {
-            if (!prefab) return;
-
-            SetParticleSystemInstance(Instantiate(prefab.gameObject), true);
-        }
-
-        public void RefreshParticles()
-        {
-            RefreshParticles(gameObject);
-        }
-
-        public void RefreshParticles(GameObject root)
-        {
-            if (!root) return;
-            root.GetComponentsInChildren(particles);
-            particles.RemoveAll(x => x.GetComponentInParent<UIParticle>() != this);
-
-            foreach (var ps in particles)
-            {
-                var tsa = ps.textureSheetAnimation;
-                if (tsa.mode == ParticleSystemAnimationMode.Sprites && tsa.uvChannelMask == (UVChannelFlags) 0)
-                    tsa.uvChannelMask = UVChannelFlags.UV0;
-            }
-
-            particles.Exec(p => p.GetComponent<ParticleSystemRenderer>().enabled = !enabled);
-            particles.SortForRendering(transform, m_ShrinkByMaterial);
-
-            SetMaterialDirty();
-        }
-
-        protected override void UpdateMaterial()
-        {
-            // Clear mask materials.
-            s_PrevMaskMaterials.AddRange(_maskMaterials);
-            _maskMaterials.Clear();
-
-            // Clear modified materials.
-            s_PrevModifiedMaterials.AddRange(_modifiedMaterials);
-            _modifiedMaterials.Clear();
-
-            // Recalculate stencil value.
-            if (m_ShouldRecalculateStencil)
-            {
-                var rootCanvas = MaskUtilities.FindRootSortOverrideCanvas(transform);
-                m_StencilValue = maskable ? MaskUtilities.GetStencilDepth(transform, rootCanvas) : 0;
-                m_ShouldRecalculateStencil = false;
-            }
-
-            // No mesh to render.
-            var count = activeMeshIndices.CountFast();
-            if (count == 0 || !isActiveAndEnabled || particles.Count == 0)
-            {
-                canvasRenderer.Clear();
-                ClearPreviousMaterials();
-                return;
-            }
-
-            //
-            GetComponents(typeof(IMaterialModifier), s_Components);
-            var materialCount = Mathf.Min(16, count);
-            canvasRenderer.materialCount = materialCount;
-            var j = 0;
-            for (var i = 0; i < particles.Count; i++)
-            {
-                if (materialCount <= j) break;
-                var ps = particles[i];
-                if (!ps) continue;
-
-                var r = ps.GetComponent<ParticleSystemRenderer>();
-                r.GetSharedMaterials(s_TempMaterials);
-
-                // Main
-                var index = i * 2;
-                if (activeMeshIndices.Count <= index) break;
-                if (activeMeshIndices[index] && 0 < s_TempMaterials.Count)
-                {
-                    var mat = GetModifiedMaterial(s_TempMaterials[0], ps.GetTextureForSprite());
-                    for (var k = 1; k < s_Components.Count; k++)
-                        mat = (s_Components[k] as IMaterialModifier).GetModifiedMaterial(mat);
-                    canvasRenderer.SetMaterial(mat, j);
-                    UpdateMaterialProperties(r, j);
-                    j++;
-                }
-
-                // Trails
-                index++;
-                if (activeMeshIndices.Count <= index || materialCount <= j) break;
-                if (activeMeshIndices[index] && 1 < s_TempMaterials.Count)
-                {
-                    var mat = GetModifiedMaterial(s_TempMaterials[1], null);
-                    for (var k = 1; k < s_Components.Count; k++)
-                        mat = (s_Components[k] as IMaterialModifier).GetModifiedMaterial(mat);
-                    canvasRenderer.SetMaterial(mat, j++);
-                }
-            }
-
-            ClearPreviousMaterials();
-        }
-
-        private void ClearPreviousMaterials()
-        {
-            foreach (var m in s_PrevMaskMaterials)
-                StencilMaterial.Remove(m);
-            s_PrevMaskMaterials.Clear();
-
-            foreach (var m in s_PrevModifiedMaterials)
-                ModifiedMaterial.Remove(m);
-            s_PrevModifiedMaterials.Clear();
-        }
-
-        private Material GetModifiedMaterial(Material baseMaterial, Texture2D texture)
-        {
-            if (0 < m_StencilValue)
-            {
-                baseMaterial = StencilMaterial.Add(baseMaterial, (1 << m_StencilValue) - 1, StencilOp.Keep, CompareFunction.Equal, ColorWriteMask.All, (1 << m_StencilValue) - 1, 0);
-                _maskMaterials.Add(baseMaterial);
-            }
-
-            if (texture == null && m_AnimatableProperties.Length == 0) return baseMaterial;
-
-            var id = m_AnimatableProperties.Length == 0 ? 0 : GetInstanceID();
-            baseMaterial = ModifiedMaterial.Add(baseMaterial, texture, id);
-            _modifiedMaterials.Add(baseMaterial);
-
-            return baseMaterial;
-        }
-
-        internal void UpdateMaterialProperties()
-        {
-            if (m_AnimatableProperties.Length == 0) return;
-
-            //
-            var count = activeMeshIndices.CountFast();
-            var materialCount = Mathf.Max(8, count);
-            canvasRenderer.materialCount = materialCount;
-            var j = 0;
-            for (var i = 0; i < particles.Count; i++)
-            {
-                if (materialCount <= j) break;
-                var ps = particles[i];
-                if (!ps) continue;
-
-                var r = ps.GetComponent<ParticleSystemRenderer>();
-                r.GetSharedMaterials(s_TempMaterials);
-
-                // Main
-                if (activeMeshIndices[i * 2] && 0 < s_TempMaterials.Count)
-                {
-                    UpdateMaterialProperties(r, j);
-                    j++;
-                }
-            }
-        }
-
-        internal void UpdateMaterialProperties(Renderer r, int index)
-        {
-            if (m_AnimatableProperties.Length == 0 || canvasRenderer.materialCount <= index) return;
-
-            r.GetPropertyBlock(s_Mpb ?? (s_Mpb = new MaterialPropertyBlock()));
-            if (s_Mpb.isEmpty) return;
-
-            // #41: Copy the value from MaterialPropertyBlock to CanvasRenderer
-            var mat = canvasRenderer.GetMaterial(index);
-            if (!mat) return;
-
-            foreach (var ap in m_AnimatableProperties)
-            {
-                ap.UpdateMaterialProperties(mat, s_Mpb);
-            }
-
-            s_Mpb.Clear();
-        }
-
-        /// <summary>
-        /// This function is called when the object becomes enabled and active.
-        /// </summary>
-        protected override void OnEnable()
-        {
-#if !SERIALIZE_FIELD_MASKABLE
-            maskable = m_Maskable;
-#endif
-            activeMeshIndices.Clear();
-
-            UIParticleUpdater.Register(this);
-            particles.Exec(p => p.GetComponent<ParticleSystemRenderer>().enabled = false);
-
-            if (isActiveAndEnabled && m_IgnoreCanvasScaler)
-            {
-                _tracker.Add(this, rectTransform, DrivenTransformProperties.Scale);
-            }
-
-            // Create objects.
-            _bakedMesh = MeshPool.Rent();
-
-            base.OnEnable();
-
-            InitializeIfNeeded();
-        }
-
-        private new IEnumerator Start()
-        {
-            // #147: ParticleSystem creates Particles in wrong position during prewarm
-            // #148: Particle Sub Emitter not showing when start game
-            var delayToPlay = particles.AnyFast(ps =>
-            {
-                ps.GetComponentsInChildren(false, s_ParticleSystems);
-                return s_ParticleSystems.AnyFast(p => p.isPlaying && (p.subEmitters.enabled || p.main.prewarm));
-            });
-            s_ParticleSystems.Clear();
-            if (!delayToPlay) yield break;
-
-            Stop();
-            Clear();
-            yield return null;
-
-            Play();
-        }
-
-        /// <summary>
-        /// This function is called when the behaviour becomes disabled.
-        /// </summary>
-        protected override void OnDisable()
-        {
-            UIParticleUpdater.Unregister(this);
-            if (!_shouldBeRemoved)
-                particles.Exec(p => p.GetComponent<ParticleSystemRenderer>().enabled = true);
-            _tracker.Clear();
-
-            // Destroy object.
-            MeshPool.Return(_bakedMesh);
-            _bakedMesh = null;
-
-            base.OnDisable();
-        }
-
-        /// <summary>
-        /// Call to update the geometry of the Graphic onto the CanvasRenderer.
-        /// </summary>
-        protected override void UpdateGeometry()
-        {
-        }
-
-        /// <summary>
-        /// Callback for when properties have been changed by animation.
-        /// </summary>
-        protected override void OnDidApplyAnimationProperties()
-        {
-        }
-
-        private void InitializeIfNeeded()
-        {
-            if (enabled && m_IsTrail)
-            {
-                UnityEngine.Debug.LogWarningFormat(this, "[UIParticle] The UIParticle component should be removed: {0}\nReason: UIParticle for trails is no longer needed.", name);
-                gameObject.hideFlags = HideFlags.None;
-                _shouldBeRemoved = true;
-                enabled = false;
-                return;
-            }
-
-            if (!this || particles.AnyFast()) return;
-
-            // refresh.
-#if UNITY_EDITOR
-            if (!Application.isPlaying)
-                UnityEditor.EditorApplication.delayCall += () =>
-                {
-                    if (this) RefreshParticles();
-                };
-            else
-#endif
-                RefreshParticles();
-        }
-
-#if UNITY_EDITOR
-        protected override void OnValidate()
-        {
-            SetLayoutDirty();
-            SetVerticesDirty();
-            m_ShouldRecalculateStencil = true;
-            RecalculateClipping();
-#if !SERIALIZE_FIELD_MASKABLE
-            maskable = m_Maskable;
-#endif
-        }
-
-        void ISerializationCallbackReceiver.OnBeforeSerialize()
-        {
-            if (Application.isPlaying) return;
-            InitializeIfNeeded();
-        }
-
-        void ISerializationCallbackReceiver.OnAfterDeserialize()
-        {
-            if (m_Scale3D == Vector3.zero)
-            {
-                scale = m_Scale;
-            }
-
-            UnityEditor.EditorApplication.delayCall += () =>
-            {
-                if (Application.isPlaying || !this) return;
-                InitializeIfNeeded();
-            };
-        }
-#endif
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/UIParticle.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: XX1NtH78UH8SrlQyxzHB2Bil/PEMF2+PcQQGcI54xKbHTn2ez/sJmVU=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: -100
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 295
Assets/ParticleEffectForUGUI/Scripts/UIParticleUpdater.cs

@@ -1,295 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Coffee.UIParticleExtensions;
-using UnityEngine;
-using UnityEngine.Profiling;
-
-namespace Coffee.UIExtensions
-{
-    internal static class UIParticleUpdater
-    {
-        static readonly List<UIParticle> s_ActiveParticles = new List<UIParticle>();
-        static MaterialPropertyBlock s_Mpb;
-        static ParticleSystem.Particle[] s_Particles = new ParticleSystem.Particle[2048];
-        private static int frameCount = 0;
-
-
-        public static void Register(UIParticle particle)
-        {
-            if (!particle) return;
-            s_ActiveParticles.Add(particle);
-        }
-
-        public static void Unregister(UIParticle particle)
-        {
-            if (!particle) return;
-            s_ActiveParticles.Remove(particle);
-        }
-
-#if UNITY_EDITOR
-        [UnityEditor.InitializeOnLoadMethod]
-#endif
-        [RuntimeInitializeOnLoadMethod]
-        private static void InitializeOnLoad()
-        {
-            MeshHelper.Init();
-            MeshPool.Init();
-            CombineInstanceArrayPool.Init();
-
-            Canvas.willRenderCanvases -= Refresh;
-            Canvas.willRenderCanvases += Refresh;
-        }
-
-        private static void Refresh()
-        {
-            // Do not allow it to be called in the same frame.
-            if (frameCount == Time.frameCount) return;
-            frameCount = Time.frameCount;
-
-            Profiler.BeginSample("[UIParticle] Refresh");
-            for (var i = 0; i < s_ActiveParticles.Count; i++)
-            {
-                try
-                {
-                    Refresh(s_ActiveParticles[i]);
-                }
-                catch (Exception e)
-                {
-                    Debug.LogException(e);
-                }
-            }
-
-            Profiler.EndSample();
-        }
-
-        private static void Refresh(UIParticle particle)
-        {
-            if (!particle || !particle.bakedMesh || !particle.canvas || !particle.canvasRenderer) return;
-
-            Profiler.BeginSample("[UIParticle] Modify scale");
-            ModifyScale(particle);
-            Profiler.EndSample();
-
-            Profiler.BeginSample("[UIParticle] Bake mesh");
-            BakeMesh(particle);
-            Profiler.EndSample();
-
-            // if (QualitySettings.activeColorSpace == ColorSpace.Linear)
-            // {
-            //     Profiler.BeginSample("[UIParticle] Modify color space to linear");
-            //     particle.bakedMesh.ModifyColorSpaceToLinear();
-            //     Profiler.EndSample();
-            // }
-
-            Profiler.BeginSample("[UIParticle] Set mesh to CanvasRenderer");
-            particle.canvasRenderer.SetMesh(particle.bakedMesh);
-            Profiler.EndSample();
-
-            Profiler.BeginSample("[UIParticle] Update Animatable Material Properties");
-            particle.UpdateMaterialProperties();
-            Profiler.EndSample();
-        }
-
-        private static void ModifyScale(UIParticle particle)
-        {
-            if (!particle.ignoreCanvasScaler || !particle.canvas) return;
-
-            // Ignore Canvas scaling.
-            var s = particle.canvas.rootCanvas.transform.localScale;
-            var modifiedScale = new Vector3(
-                Mathf.Approximately(s.x, 0) ? 1 : 1 / s.x,
-                Mathf.Approximately(s.y, 0) ? 1 : 1 / s.y,
-                Mathf.Approximately(s.z, 0) ? 1 : 1 / s.z);
-
-            // Scale is already modified.
-            var transform = particle.transform;
-            if (Mathf.Approximately((transform.localScale - modifiedScale).sqrMagnitude, 0)) return;
-
-            transform.localScale = modifiedScale;
-        }
-
-        private static Matrix4x4 GetScaledMatrix(ParticleSystem particle)
-        {
-            var transform = particle.transform;
-            var main = particle.main;
-            var space = main.simulationSpace;
-            if (space == ParticleSystemSimulationSpace.Custom && !main.customSimulationSpace)
-                space = ParticleSystemSimulationSpace.Local;
-
-            switch (space)
-            {
-                case ParticleSystemSimulationSpace.Local:
-                    return Matrix4x4.Rotate(transform.rotation).inverse
-                           * Matrix4x4.Scale(transform.lossyScale).inverse;
-                case ParticleSystemSimulationSpace.World:
-                    return transform.worldToLocalMatrix;
-                case ParticleSystemSimulationSpace.Custom:
-                    // #78: Support custom simulation space.
-                    return transform.worldToLocalMatrix
-                           * Matrix4x4.Translate(main.customSimulationSpace.position);
-                default:
-                    return Matrix4x4.identity;
-            }
-        }
-
-        private static void BakeMesh(UIParticle particle)
-        {
-            // Clear mesh before bake.
-            Profiler.BeginSample("[UIParticle] Bake Mesh > Clear mesh before bake");
-            MeshHelper.Clear();
-            particle.bakedMesh.Clear(false);
-            Profiler.EndSample();
-
-            // Get camera for baking mesh.
-            var camera = BakingCamera.GetCamera(particle.canvas);
-            var root = particle.transform;
-            var rootMatrix = Matrix4x4.Rotate(root.rotation).inverse
-                             * Matrix4x4.Scale(root.lossyScale).inverse;
-            var scale = particle.ignoreCanvasScaler
-                ? Vector3.Scale(particle.canvas.rootCanvas.transform.localScale, particle.scale3D)
-                : particle.scale3D;
-            var scaleMatrix = Matrix4x4.Scale(scale);
-
-            // Cache position
-            var position = particle.transform.position;
-            var diff = position - particle.cachedPosition;
-            diff.x *= 1f - 1f / Mathf.Max(0.001f, scale.x);
-            diff.y *= 1f - 1f / Mathf.Max(0.001f, scale.y);
-            diff.z *= 1f - 1f / Mathf.Max(0.001f, scale.z);
-
-            particle.cachedPosition = position;
-
-            if (particle.activeMeshIndices.CountFast() == 0)
-                diff = Vector3.zero;
-
-            for (var i = 0; i < particle.particles.Count; i++)
-            {
-                Profiler.BeginSample("[UIParticle] Bake Mesh > Push index");
-                MeshHelper.activeMeshIndices.Add(false);
-                MeshHelper.activeMeshIndices.Add(false);
-                Profiler.EndSample();
-
-                // No particle to render.
-                var currentPs = particle.particles[i];
-                if (!currentPs || !currentPs.IsAlive() || currentPs.particleCount == 0) continue;
-                var r = currentPs.GetComponent<ParticleSystemRenderer>();
-                if (!r.sharedMaterial && !r.trailMaterial) continue;
-
-                // Calc matrix.
-                Profiler.BeginSample("[UIParticle] Bake Mesh > Calc matrix");
-                var matrix = rootMatrix;
-                if (currentPs.transform != root)
-                {
-                    if (currentPs.main.simulationSpace == ParticleSystemSimulationSpace.Local)
-                    {
-                        var relativePos = root.InverseTransformPoint(currentPs.transform.position);
-                        matrix = Matrix4x4.Translate(relativePos) * matrix;
-                    }
-                    else
-                    {
-                        matrix = matrix * Matrix4x4.Translate(-root.position);
-                    }
-                }
-                else
-                {
-                    matrix = GetScaledMatrix(currentPs);
-                }
-
-                matrix = scaleMatrix * matrix;
-                Profiler.EndSample();
-
-                // Extra world simulation.
-                if (currentPs.main.simulationSpace == ParticleSystemSimulationSpace.World && 0 < diff.sqrMagnitude)
-                {
-                    Profiler.BeginSample("[UIParticle] Bake Mesh > Extra world simulation");
-                    var count = currentPs.particleCount;
-                    if (s_Particles.Length < count)
-                    {
-                        var size = Mathf.NextPowerOfTwo(count);
-                        s_Particles = new ParticleSystem.Particle[size];
-                    }
-
-                    currentPs.GetParticles(s_Particles);
-                    for (var j = 0; j < count; j++)
-                    {
-                        var p = s_Particles[j];
-                        p.position += diff;
-                        s_Particles[j] = p;
-                    }
-
-                    currentPs.SetParticles(s_Particles, count);
-                    Profiler.EndSample();
-                }
-
-#if UNITY_2018_3_OR_NEWER
-                // #102: Do not bake particle system to mesh when the alpha is zero.
-                if (Mathf.Approximately(particle.canvasRenderer.GetInheritedAlpha(), 0))
-                    continue;
-#endif
-
-                // Bake main particles.
-                if (CanBakeMesh(r))
-                {
-                    Profiler.BeginSample("[UIParticle] Bake Mesh > Bake Main Particles");
-                    var hash = currentPs.GetMaterialHash(false);
-                    if (hash != 0)
-                    {
-                        var m = MeshHelper.GetTemporaryMesh();
-                        r.BakeMesh(m, camera, true);
-                        MeshHelper.Push(i * 2, hash, m, matrix);
-                    }
-
-                    Profiler.EndSample();
-                }
-
-                // Bake trails particles.
-                if (currentPs.trails.enabled)
-                {
-                    Profiler.BeginSample("[UIParticle] Bake Mesh > Bake Trails Particles");
-                    var hash = currentPs.GetMaterialHash(true);
-                    if (hash != 0)
-                    {
-                        matrix = currentPs.main.simulationSpace == ParticleSystemSimulationSpace.Local && currentPs.trails.worldSpace
-                            ? matrix * Matrix4x4.Translate(-currentPs.transform.position)
-                            : matrix;
-
-                        var m = MeshHelper.GetTemporaryMesh();
-                        try
-                        {
-                            r.BakeTrailsMesh(m, camera, true);
-                            MeshHelper.Push(i * 2 + 1, hash, m, matrix);
-                        }
-                        catch
-                        {
-                            MeshHelper.DiscardTemporaryMesh(m);
-                        }
-                    }
-
-                    Profiler.EndSample();
-                }
-            }
-
-            // Set active indices.
-            Profiler.BeginSample("[UIParticle] Bake Mesh > Set active indices");
-            particle.activeMeshIndices = MeshHelper.activeMeshIndices;
-            Profiler.EndSample();
-
-            // Combine
-            Profiler.BeginSample("[UIParticle] Bake Mesh > CombineMesh");
-            MeshHelper.CombineMesh(particle.bakedMesh);
-            MeshHelper.Clear();
-            Profiler.EndSample();
-        }
-
-        private static bool CanBakeMesh(ParticleSystemRenderer renderer)
-        {
-            // #69: Editor crashes when mesh is set to null when `ParticleSystem.RenderMode = Mesh`
-            if (renderer.renderMode == ParticleSystemRenderMode.Mesh && renderer.mesh == null) return false;
-
-            // #61: When `ParticleSystem.RenderMode = None`, an error occurs
-            if (renderer.renderMode == ParticleSystemRenderMode.None) return false;
-
-            return true;
-        }
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/UIParticleUpdater.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: XHtMty34BnxsXP47jchKm8PRnq7a8z4oE86MVK8bttY+0XB1hYZI428=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: -100
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 299
Assets/ParticleEffectForUGUI/Scripts/Utils.cs

@@ -1,299 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Reflection;
-using UnityEngine;
-using Object = UnityEngine.Object;
-
-namespace Coffee.UIParticleExtensions
-{
-    internal static class SpriteExtensions
-    {
-#if UNITY_EDITOR
-        private static Type tSpriteEditorExtension =
-            Type.GetType("UnityEditor.Experimental.U2D.SpriteEditorExtension, UnityEditor")
-            ?? Type.GetType("UnityEditor.U2D.SpriteEditorExtension, UnityEditor");
-
-        private static MethodInfo miGetActiveAtlasTexture = tSpriteEditorExtension
-            .GetMethod("GetActiveAtlasTexture", BindingFlags.Static | BindingFlags.NonPublic);
-
-        public static Texture2D GetActualTexture(this Sprite self)
-        {
-            if (!self) return null;
-
-            if (Application.isPlaying) return self.texture;
-            var ret = miGetActiveAtlasTexture.Invoke(null, new[] {self}) as Texture2D;
-            return ret ? ret : self.texture;
-        }
-#else
-        internal static Texture2D GetActualTexture(this Sprite self)
-        {
-            return self ? self.texture : null;
-        }
-#endif
-    }
-
-    internal static class ListExtensions
-    {
-        public static bool SequenceEqualFast(this List<bool> self, List<bool> value)
-        {
-            if (self.Count != value.Count) return false;
-            for (var i = 0; i < self.Count; ++i)
-            {
-                if (self[i] != value[i]) return false;
-            }
-
-            return true;
-        }
-
-        public static int CountFast(this List<bool> self)
-        {
-            var count = 0;
-            for (var i = 0; i < self.Count; ++i)
-            {
-                if (self[i]) count++;
-            }
-
-            return count;
-        }
-
-        public static bool AnyFast<T>(this List<T> self) where T : Object
-        {
-            for (var i = 0; i < self.Count; ++i)
-            {
-                if (self[i]) return true;
-            }
-
-            return false;
-        }
-
-        public static bool AnyFast<T>(this List<T> self, Predicate<T> predicate) where T : Object
-        {
-            for (var i = 0; i < self.Count; ++i)
-            {
-                if (self[i] && predicate(self[i])) return true;
-            }
-
-            return false;
-        }
-    }
-
-    internal static class MeshExtensions
-    {
-        // static readonly List<Color32> s_Colors = new List<Color32>();
-
-        // public static void ModifyColorSpaceToLinear(this Mesh self)
-        // {
-        //     self.GetColors(s_Colors);
-        //
-        //     for (var i = 0; i < s_Colors.Count; i++)
-        //         s_Colors[i] = ((Color) s_Colors[i]).gamma;
-        //
-        //     self.SetColors(s_Colors);
-        //     s_Colors.Clear();
-        // }
-
-        public static void Clear(this CombineInstance[] self)
-        {
-            for (var i = 0; i < self.Length; i++)
-            {
-                MeshPool.Return(self[i].mesh);
-                self[i].mesh = null;
-            }
-        }
-    }
-
-    internal static class MeshPool
-    {
-        private static readonly Stack<Mesh> s_Pool = new Stack<Mesh>(32);
-        private static readonly HashSet<int> s_HashPool = new HashSet<int>();
-
-        public static void Init()
-        {
-        }
-
-        static MeshPool()
-        {
-            for (var i = 0; i < 32; i++)
-            {
-                var m = new Mesh();
-                m.MarkDynamic();
-                s_Pool.Push(m);
-                s_HashPool.Add(m.GetInstanceID());
-            }
-        }
-
-        public static Mesh Rent()
-        {
-            Mesh m;
-            while (0 < s_Pool.Count)
-            {
-                m = s_Pool.Pop();
-                if (m)
-                {
-                    s_HashPool.Remove(m.GetInstanceID());
-                    return m;
-                }
-            }
-
-            m = new Mesh();
-            m.MarkDynamic();
-            return m;
-        }
-
-        public static void Return(Mesh mesh)
-        {
-            if (!mesh) return;
-
-            var id = mesh.GetInstanceID();
-            if (s_HashPool.Contains(id)) return;
-
-            mesh.Clear(false);
-            s_Pool.Push(mesh);
-            s_HashPool.Add(id);
-        }
-    }
-
-    internal static class CombineInstanceArrayPool
-    {
-        private static readonly Dictionary<int, CombineInstance[]> s_Pool;
-
-        public static void Init()
-        {
-            s_Pool.Clear();
-        }
-
-        static CombineInstanceArrayPool()
-        {
-            s_Pool = new Dictionary<int, CombineInstance[]>();
-        }
-
-        public static CombineInstance[] Get(List<CombineInstance> src)
-        {
-            CombineInstance[] dst;
-            var count = src.Count;
-            if (!s_Pool.TryGetValue(count, out dst))
-            {
-                dst = new CombineInstance[count];
-                s_Pool.Add(count, dst);
-            }
-
-            for (var i = 0; i < src.Count; i++)
-            {
-                dst[i].mesh = src[i].mesh;
-                dst[i].transform = src[i].transform;
-            }
-
-            return dst;
-        }
-
-        public static CombineInstance[] Get(List<CombineInstanceEx> src, int count)
-        {
-            CombineInstance[] dst;
-            if (!s_Pool.TryGetValue(count, out dst))
-            {
-                dst = new CombineInstance[count];
-                s_Pool.Add(count, dst);
-            }
-
-            for (var i = 0; i < count; i++)
-            {
-                dst[i].mesh = src[i].mesh;
-                dst[i].transform = src[i].transform;
-            }
-
-            return dst;
-        }
-    }
-
-    internal static class ParticleSystemExtensions
-    {
-        public static void SortForRendering(this List<ParticleSystem> self, Transform transform, bool sortByMaterial)
-        {
-            self.Sort((a, b) =>
-            {
-                var tr = transform;
-                var aRenderer = a.GetComponent<ParticleSystemRenderer>();
-                var bRenderer = b.GetComponent<ParticleSystemRenderer>();
-
-                // Render queue: ascending
-                var aMat = aRenderer.sharedMaterial ?? aRenderer.trailMaterial;
-                var bMat = bRenderer.sharedMaterial ?? bRenderer.trailMaterial;
-                if (!aMat && !bMat) return 0;
-                if (!aMat) return -1;
-                if (!bMat) return 1;
-
-                if (sortByMaterial)
-                    return aMat.GetInstanceID() - bMat.GetInstanceID();
-
-                if (aMat.renderQueue != bMat.renderQueue)
-                    return aMat.renderQueue - bMat.renderQueue;
-
-                // Sorting layer: ascending
-                if (aRenderer.sortingLayerID != bRenderer.sortingLayerID)
-                    return aRenderer.sortingLayerID - bRenderer.sortingLayerID;
-
-                // Sorting order: ascending
-                if (aRenderer.sortingOrder != bRenderer.sortingOrder)
-                    return aRenderer.sortingOrder - bRenderer.sortingOrder;
-
-                // Z position & sortingFudge: descending
-                var aTransform = a.transform;
-                var bTransform = b.transform;
-                var aPos = tr.InverseTransformPoint(aTransform.position).z + aRenderer.sortingFudge;
-                var bPos = tr.InverseTransformPoint(bTransform.position).z + bRenderer.sortingFudge;
-                if (!Mathf.Approximately(aPos, bPos))
-                    return (int) Mathf.Sign(bPos - aPos);
-
-                return (int) Mathf.Sign(GetIndex(self, a) - GetIndex(self, b));
-            });
-        }
-
-        private static int GetIndex(IList<ParticleSystem> list, Object ps)
-        {
-            for (var i = 0; i < list.Count; i++)
-            {
-                if (list[i].GetInstanceID() == ps.GetInstanceID()) return i;
-            }
-
-            return 0;
-        }
-
-        public static long GetMaterialHash(this ParticleSystem self, bool trail)
-        {
-            if (!self) return 0;
-
-            var r = self.GetComponent<ParticleSystemRenderer>();
-            var mat = trail ? r.trailMaterial : r.sharedMaterial;
-
-            if (!mat) return 0;
-
-            var tex = trail ? null : self.GetTextureForSprite();
-            return ((long) mat.GetHashCode() << 32) + (tex ? tex.GetHashCode() : 0);
-        }
-
-        public static Texture2D GetTextureForSprite(this ParticleSystem self)
-        {
-            if (!self) return null;
-
-            // Get sprite's texture.
-            var tsaModule = self.textureSheetAnimation;
-            if (!tsaModule.enabled || tsaModule.mode != ParticleSystemAnimationMode.Sprites) return null;
-
-            for (var i = 0; i < tsaModule.spriteCount; i++)
-            {
-                var sprite = tsaModule.GetSprite(i);
-                if (!sprite) continue;
-
-                return sprite.GetActualTexture();
-            }
-
-            return null;
-        }
-
-        public static void Exec(this List<ParticleSystem> self, Action<ParticleSystem> action)
-        {
-            self.RemoveAll(p => !p);
-            self.ForEach(action);
-        }
-    }
-}

+ 0 - 11
Assets/ParticleEffectForUGUI/Scripts/Utils.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: Cn1LsimtVH5R1Xc5GEr/G9E/XdkBR8tzcGoE3J6ZDKa2S/9Q21G4Kr0=
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 1
Assets/ParticleEffectForUGUI/说明.txt

@@ -1 +0,0 @@
-https://github.com/mob-sakai/ParticleEffectForUGUI

+ 0 - 7
Assets/ParticleEffectForUGUI/说明.txt.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: W38f5i6vUXzo1G0ZAnKQinxzOscyUByp+LGRMdEaLoTtnxtzmtL956s=
-TextScriptImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: