示例#1
0
        private static void FindOrCreateWorldDescriptor()
        {
            _worldDescriptor = SceneUtils.GetObjectsInScene <WorldDescriptor>(true).FirstOrDefault();

            if (_worldDescriptor != null)
            {
                _worldDescriptor.gameObject.SetActive(true);

                FindOrCreateSpawnPoint(_worldDescriptor);
                return;
            }

            GameObject worldDescriptorGo = new GameObject("[World Descriptor]");

            worldDescriptorGo.transform.position   = Vector3.zero;
            worldDescriptorGo.transform.rotation   = Quaternion.identity;
            worldDescriptorGo.transform.localScale = Vector3.one;

            _worldDescriptor = worldDescriptorGo.AddComponent <WorldDescriptor>();

            FindOrCreateSpawnPoint(_worldDescriptor);
        }