Esempio n. 1
0
        /// <summary>
        /// This function is called when the object becomes enabled and active.
        /// </summary>
        protected override void OnEnable()
        {
            _cachedPosition    = transform.localPosition;
            _activeMeshIndices = 0;

            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();
        }
Esempio n. 2
0
        /// <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();
        }
Esempio n. 3
0
        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;
            }
            }
        }
Esempio n. 4
0
 public static Mesh GetTemporaryMesh()
 {
     return(MeshPool.Rent());
 }