/// <summary> /// MonoBehaviour 개체를 초기화합니다. /// </summary> void Start() { /* * // 예외 메시지 리스트를 생성합니다. * List<string> exceptionList = new List<string>(); * * // 빈 필드가 존재하는 경우 예외 메시지를 추가합니다. * if (_stageManager == null) * exceptionList.Add("CameraZoneParent.StageManager == null"); * if (_database == null) * exceptionList.Add("CameraZoneParent.DataBase == null"); * * // 예외 메시지가 하나 이상 존재하는 경우 예외를 발생하고 중지합니다. * if (exceptionList.Count > 0) * { * foreach (string msg in exceptionList) * { * Handy.Log("CameraZoneParent Error: {0}", msg); * } * throw new Exception("데이터베이스 필드 정의 부족"); * } */ // 필드를 초기화합니다. _database = DataBase.Instance; _stageManager = StageManager1P.Instance; _cameraFollow = _database.CameraFollow; }
/// <summary> /// MonoBehaviour 개체를 초기화합니다. /// </summary> void Start() { // 필드를 초기화합니다. _database = DataBase.Instance; _stageManager = StageManager1P.Instance; _cameraFollow = _database.CameraFollow; }
/// <summary> /// MonoBehaviour 개체를 초기화합니다. /// </summary> void Start() { /** * // 예외 메시지 리스트를 생성합니다. * List<string> exceptionList = new List<string>(); * * // 빈 필드가 존재하는 경우 예외 메시지를 추가합니다. * if (_stageManager == null) * exceptionList.Add("Map.StageManager == null"); * * // 예외 메시지가 하나 이상 존재하는 경우 예외를 발생하고 중지합니다. * if (exceptionList.Count > 0) * { * foreach (string msg in exceptionList) * { * Handy.Log("DataBase Error: {0}", msg); * } * throw new Exception("데이터베이스 필드 정의 부족"); * } */ // 필드를 초기화합니다. _stageManager = StageManager1P.Instance; _cameraZoneParent = GetComponentInChildren <CameraZoneParent>(); }
/// <summary> /// 플레이어를 소환합니다. /// </summary> void FE_SpawnPlayer() { if (_stageManager is StageManager1P) { StageManager1P stageManager = (StageManager1P)_stageManager; // HUD를 활성화 합니다. stageManager.EnableHUD(); // 플레이어 소환을 요청합니다. stageManager._player.transform.position = _stageManager._PlayerSpawnPosition.position; stageManager._player.RequestSpawn(); } else if (_stageManager is StageManager2P) { StageManager2P stageManager = (StageManager2P)_stageManager; // HUD를 활성화 합니다. stageManager.EnableHUD(); // 플레이어 소환을 요청합니다. Vector3 mainSpawnPos = stageManager._PlayerSpawnPosition.position; stageManager.MainPlayer.transform.position = mainSpawnPos; stageManager.MainPlayer.RequestSpawn(); stageManager.SubPlayer.transform.position = new Vector3 (mainSpawnPos.x - 1, mainSpawnPos.y); stageManager.SubPlayer.RequestSpawn(); } else { throw new Exception("알 수 없는 스테이지 관리자 형식"); } }