using UnityEngine; using XGame.Framework.ObjectCollection; namespace XGame.Framework.Map { /// /// 地图根节点 /// [DisallowMultipleComponent] [AddComponentMenu("XGame/Map/MapBehaviour")] public class MapBehaviour : MonoBehaviour { /// /// 序列化器 /// [SerializeField] private ObjectCollector _collector = new ObjectCollector(); /// /// 地图相机 /// [SerializeField] private Camera _camera; /// /// 序列化器 /// public IObjectCollector Collector => _collector; /// /// 地图相机 /// public Camera Camera => _camera; private void Start() { if (_camera == null) { _camera = transform.GetComponentInChildren(); } if (_camera == null) { _camera = Camera.main; } if ( _camera == null) { Log.Error($"地图没有相机.Name:{gameObject.name}"); } } } }