UnityEditor.CollisionModuleUI.CreateEmptyGameObject C# (CSharp) Method

CreateEmptyGameObject() private static method

private static CreateEmptyGameObject ( string name, ParticleSystem parentOfGameObject ) : GameObject
name string
parentOfGameObject UnityEngine.ParticleSystem
return UnityEngine.GameObject
        private static GameObject CreateEmptyGameObject(string name, ParticleSystem parentOfGameObject)
        {
            GameObject obj2 = new GameObject(name);
            if (obj2 == null)
            {
                return null;
            }
            if (parentOfGameObject != null)
            {
                obj2.transform.parent = parentOfGameObject.transform;
            }
            return obj2;
        }

Usage Example

        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();
                }
            }
        }
All Usage Examples Of UnityEditor.CollisionModuleUI::CreateEmptyGameObject