/// <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(); }
/// <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(); }
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 static Mesh GetTemporaryMesh() { return(MeshPool.Rent()); }