UnityEditor.ParticleEffectUtils.HidePlaneIfExists C# (CSharp) Method

HidePlaneIfExists() public static method

public static HidePlaneIfExists ( int index ) : void
index int
return void
        public static void HidePlaneIfExists(int index)
        {
            if (index < s_Planes.Count)
            {
                s_Planes[index].transform.localScale = Vector3.zero;
            }
        }
    }

Usage Example

示例#1
0
 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)
         {
             ParticleEffectUtils.HidePlaneIfExists(i);
         }
         else
         {
             Transform transform = objectReferenceValue as Transform;
             if (transform == null)
             {
                 ParticleEffectUtils.HidePlaneIfExists(i);
             }
             else
             {
                 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);
                 plane.transform.position  += transform.up.normalized * 0.002f;
             }
         }
     }
 }