public void DestroyCurrentMap()
        {
            while (transform.childCount > 0)
            {
                foreach (Transform child in transform)
                {
                    GameObject.DestroyImmediate(child.gameObject);
                }
            }

            GOEnvironment env = GameObject.FindObjectOfType <GOEnvironment>();

            if (env == null)
            {
                return;
            }

            while (env.transform.childCount > 0)
            {
                foreach (Transform child in env.transform)
                {
                    GameObject.DestroyImmediate(child.gameObject);
                }
            }
        }
Beispiel #2
0
        public void DestroyCurrentMap()
        {
            GOMap map = GetComponent <GOMap> ();

            if (map == null)
            {
                Debug.LogError("[GOMap Editor] GOMap script not found");
                return;
            }

            while (map.transform.childCount > 0)
            {
                foreach (Transform child in map.transform)
                {
                    GameObject.DestroyImmediate(child.gameObject);
                }
            }

            GOEnvironment env = GameObject.FindObjectOfType <GOEnvironment>();

            if (env == null)
            {
                return;
            }

            while (env.transform.childCount > 0)
            {
                foreach (Transform child in env.transform)
                {
                    GameObject.DestroyImmediate(child.gameObject);
                }
            }
        }