CreateEmptyGameObject() private static method

private static CreateEmptyGameObject ( string name, ParticleSystem parentOfGameObject ) : GameObject
name string
parentOfGameObject UnityEngine.ParticleSystem
return UnityEngine.GameObject
        private void DoListOfPlanesGUI()
        {
            int num = base.GUIListOfFloatObjectToggleFields(CollisionModuleUI.s_Texts.planes, this.m_ShownPlanes, null, CollisionModuleUI.s_Texts.createPlane, true);

            if (num >= 0)
            {
                GameObject gameObject = CollisionModuleUI.CreateEmptyGameObject("Plane Transform " + (num + 1), this.m_ParticleSystemUI.m_ParticleSystem);
                gameObject.transform.localPosition           = new Vector3(0f, 0f, (float)(10 + num));
                gameObject.transform.localEulerAngles        = new Vector3(-90f, 0f, 0f);
                this.m_ShownPlanes[num].objectReferenceValue = gameObject;
                this.SyncVisualization();
            }
            Rect rect = GUILayoutUtility.GetRect(0f, 16f);

            rect.x     = rect.xMax - 24f - 5f;
            rect.width = 12f;
            if (this.m_ShownPlanes.Length > 1 && ModuleUI.MinusButton(rect))
            {
                this.m_ShownPlanes[this.m_ShownPlanes.Length - 1].objectReferenceValue = null;
                List <SerializedProperty> list = new List <SerializedProperty>(this.m_ShownPlanes);
                list.RemoveAt(list.Count - 1);
                this.m_ShownPlanes = list.ToArray();
            }
            if (this.m_ShownPlanes.Length < 6)
            {
                rect.x += 17f;
                if (ModuleUI.PlusButton(rect))
                {
                    List <SerializedProperty> list2 = new List <SerializedProperty>(this.m_ShownPlanes);
                    list2.Add(this.m_Planes[list2.Count]);
                    this.m_ShownPlanes = list2.ToArray();
                }
            }
        }
示例#2
0
 private void DoListOfPlanesGUI()
 {
     if (!this.IsListOfPlanesValid())
     {
         EditorGUILayout.HelpBox("Plane list editing is only available when all selected systems contain the same number of planes", MessageType.Info, true);
     }
     else
     {
         EditorGUI.BeginChangeCheck();
         int  num  = base.GUIListOfFloatObjectToggleFields(CollisionModuleUI.s_Texts.planes, this.m_ShownPlanes, null, CollisionModuleUI.s_Texts.createPlane, !this.m_ParticleSystemUI.multiEdit, new GUILayoutOption[0]);
         bool flag = EditorGUI.EndChangeCheck();
         if (num >= 0 && !this.m_ParticleSystemUI.multiEdit)
         {
             GameObject gameObject = CollisionModuleUI.CreateEmptyGameObject("Plane Transform " + (num + 1), this.m_ParticleSystemUI.m_ParticleSystems[0]);
             gameObject.transform.localPosition           = new Vector3(0f, 0f, (float)(10 + num));
             gameObject.transform.localEulerAngles        = new Vector3(-90f, 0f, 0f);
             this.m_ShownPlanes[num].objectReferenceValue = gameObject;
             flag = true;
         }
         Rect rect = GUILayoutUtility.GetRect(0f, 16f);
         rect.x     = rect.xMax - 24f - 5f;
         rect.width = 12f;
         if (this.m_ShownPlanes.Length > 1)
         {
             if (ModuleUI.MinusButton(rect))
             {
                 this.m_ShownPlanes[this.m_ShownPlanes.Length - 1].objectReferenceValue = null;
                 List <SerializedProperty> list = new List <SerializedProperty>(this.m_ShownPlanes);
                 list.RemoveAt(list.Count - 1);
                 this.m_ShownPlanes = list.ToArray();
                 flag = true;
             }
         }
         if (this.m_ShownPlanes.Length < 6 && !this.m_ParticleSystemUI.multiEdit)
         {
             rect.x += 17f;
             if (ModuleUI.PlusButton(rect))
             {
                 List <SerializedProperty> list2 = new List <SerializedProperty>(this.m_ShownPlanes);
                 list2.Add(this.m_Planes[list2.Count]);
                 this.m_ShownPlanes = list2.ToArray();
             }
         }
         if (flag)
         {
             this.SyncVisualization();
         }
     }
 }
        private void DoListOfPlanesGUI()
        {
            int index = this.GUIListOfFloatObjectToggleFields(CollisionModuleUI.s_Texts.planes, this.m_ShownPlanes, (EditorGUI.ObjectFieldValidator)null, CollisionModuleUI.s_Texts.createPlane, true);

            if (index >= 0)
            {
                GameObject emptyGameObject = CollisionModuleUI.CreateEmptyGameObject("Plane Transform " + (object)(index + 1), this.m_ParticleSystemUI.m_ParticleSystem);
                emptyGameObject.transform.localPosition        = new Vector3(0.0f, 0.0f, (float)(10 + index));
                emptyGameObject.transform.localEulerAngles     = new Vector3(-90f, 0.0f, 0.0f);
                this.m_ShownPlanes[index].objectReferenceValue = (Object)emptyGameObject;
                this.SyncVisualization();
            }
            Rect rect = GUILayoutUtility.GetRect(0.0f, 16f);

            rect.x     = (float)((double)rect.xMax - 24.0 - 5.0);
            rect.width = 12f;
            if (this.m_ShownPlanes.Length > 1 && ModuleUI.MinusButton(rect))
            {
                this.m_ShownPlanes[this.m_ShownPlanes.Length - 1].objectReferenceValue = (Object)null;
                List <SerializedProperty> serializedPropertyList = new List <SerializedProperty>((IEnumerable <SerializedProperty>) this.m_ShownPlanes);
                serializedPropertyList.RemoveAt(serializedPropertyList.Count - 1);
                this.m_ShownPlanes = serializedPropertyList.ToArray();
            }
            if (this.m_ShownPlanes.Length >= 6)
            {
                return;
            }
            rect.x += 17f;
            if (!ModuleUI.PlusButton(rect))
            {
                return;
            }
            List <SerializedProperty> serializedPropertyList1 = new List <SerializedProperty>((IEnumerable <SerializedProperty>) this.m_ShownPlanes);

            serializedPropertyList1.Add(this.m_Planes[serializedPropertyList1.Count]);
            this.m_ShownPlanes = serializedPropertyList1.ToArray();
        }