UnityEditor.ParticleEffectUtils.GetPlane C# (CSharp) Method

GetPlane() public static method

public static GetPlane ( int index ) : GameObject
index int
return UnityEngine.GameObject
        public static GameObject GetPlane(int index)
        {
            while (s_Planes.Count <= index)
            {
                GameObject item = GameObject.CreatePrimitive(PrimitiveType.Plane);
                item.hideFlags = HideFlags.HideAndDontSave;
                s_Planes.Add(item);
            }
            return s_Planes[index];
        }

Usage Example

 private void SyncVisualization()
 {
     if (!base.enabled)
     {
         return;
     }
     if (this.m_PlaneVisualizationType != CollisionModuleUI.PlaneVizType.Solid)
     {
         return;
     }
     for (int i = 0; i < this.m_ShownPlanes.Length; i++)
     {
         UnityEngine.Object objectReferenceValue = this.m_ShownPlanes[i].objectReferenceValue;
         if (!(objectReferenceValue == null))
         {
             Transform transform = objectReferenceValue as Transform;
             if (!(transform == null))
             {
                 GameObject plane = ParticleEffectUtils.GetPlane(i);
                 plane.transform.position   = transform.position;
                 plane.transform.rotation   = transform.rotation;
                 plane.transform.localScale = new Vector3(this.m_ScaleGrid, this.m_ScaleGrid, this.m_ScaleGrid);
             }
         }
     }
 }
All Usage Examples Of UnityEditor.ParticleEffectUtils::GetPlane