private void Start() { if (MainController.Instance != null) { int BossID = MainController.Instance.GetStageInfo_BossID(MainController.Instance.SelectStageKind); GameObject obj = ResourceManager.GetOBJCreatePrefab(@"Prefab_Monster\" + MainController.Instance.GetStageBossInfo(BossID).AnimName, Position_Boss.transform); SoundManager.Instance.PlayBGM(eBGMState.Boss_Stage); // 배경 및 BGM 변경 switch (MainController.Instance.SelectStageKind) { case eStageKind.STAGE1: Img_Background.sprite = m_Background[0]; CharacterBoss_KingSlime kingslime = obj.GetComponent <CharacterBoss_KingSlime>(); m_BossInfo = kingslime; m_BossInfo.m_HPBar = Position_Boss_HPBar; m_BossInfo.Position_Damage = Position_Boss_Damage; //m_BossInfo.m_CharacterAnimation = BossAnimcontroller; break; case eStageKind.STAGE2: Img_Background.sprite = m_Background[1]; CharacterBoss_GiantTree giantTree = obj.GetComponent <CharacterBoss_GiantTree>(); m_BossInfo = giantTree; m_BossInfo.m_HPBar = Position_Boss_HPBar; m_BossInfo.Position_Damage = Position_Boss_Damage; break; case eStageKind.STAGE3: Img_Background.sprite = m_Background[2]; CharacterBoss_WeirdSlime weridSlime = obj.GetComponent <CharacterBoss_WeirdSlime>(); m_BossInfo = weridSlime; m_BossInfo.m_HPBar = Position_Boss_HPBar; m_BossInfo.Position_Damage = Position_Boss_Damage; break; case eStageKind.STAGE4: Img_Background.sprite = m_Background[3]; CharacterBoss_AntLion antLion = obj.GetComponent <CharacterBoss_AntLion>(); m_BossInfo = antLion; m_BossInfo.m_HPBar = Position_Boss_HPBar; m_BossInfo.Position_Damage = Position_Boss_Damage; break; case eStageKind.STAGE5: Img_Background.sprite = m_Background[4]; CharacterBoss_IceGolem iceGolem = obj.GetComponent <CharacterBoss_IceGolem>(); m_BossInfo = iceGolem; m_BossInfo.m_HPBar = Position_Boss_HPBar; m_BossInfo.Position_Damage = Position_Boss_Damage; break; } // 용사 초기화 m_HeroInfo.Initialize(); m_HeroInfo.Position_Damage = Obj_Damage_Position; m_HeroInfo.SetSkin(SetHeroAnimArmorSkinLevel(), SetHeroAnimSwordSkinLevel()); m_HeroInfo.PlayAnimation(eCharacterAnimState.Standing, true); // 보스 초기화 m_BossInfo.Initialize(BossID); switch (MainController.Instance.SelectStageKind) { case eStageKind.STAGE1: case eStageKind.STAGE2: case eStageKind.STAGE3: case eStageKind.STAGE4: StartCoroutine(StartCountDown()); break; case eStageKind.STAGE5: // 스토리 진행 때문에 별도로 진행 if (MainController.Instance.UserInfo.GetTutorialStoryClear(eStoryState.Stage5BossStageStory) == false) { TutorialStorySystem.Instance.StartSpeach(eStoryState.Stage5BossStageStory); } else { StartCoroutine(StartCountDown()); } break; } } }
// Start is called before the first frame update void Start() { // 화면 꺼짐 방지 Screen.sleepTimeout = SleepTimeout.NeverSleep; if (MainController.Instance != null) { SoundManager.Instance.PlayBGM(eBGMState.Stage); #region Background Image Change : 배경 이미지 변경 Img_RearBG1.sprite = m_RearBG[(int)MainController.Instance.SelectStageKind]; Img_RearBG2.sprite = m_RearBG[(int)MainController.Instance.SelectStageKind]; Img_Front1.sprite = m_FrontBG[(int)MainController.Instance.SelectStageKind]; Img_Front2.sprite = m_FrontBG[(int)MainController.Instance.SelectStageKind]; switch (MainController.Instance.SelectStageKind) { case eStageKind.STAGE1: Img_Front1.rectTransform.sizeDelta = new Vector2(2048, 342); Img_Front1.transform.localPosition = new Vector3( Img_Front1.transform.localPosition.x, -330, 0); Img_Front2.rectTransform.sizeDelta = new Vector2(2048, 342); Img_Front2.transform.localPosition = new Vector3( Img_Front2.transform.localPosition.x, -330, 0); break; case eStageKind.STAGE2: Img_Town.rectTransform.sizeDelta = new Vector2(1649, 833.5f); break; case eStageKind.STAGE3: Img_Town.enabled = false; break; case eStageKind.STAGE4: Img_Front1.rectTransform.sizeDelta = new Vector2(2048, 474); Img_Front1.transform.localPosition = new Vector3( Img_Front1.transform.localPosition.x, -270, 0); Img_Front2.rectTransform.sizeDelta = new Vector2(2048, 474); Img_Front2.transform.localPosition = new Vector3( Img_Front2.transform.localPosition.x, -270, 0); Img_Town.rectTransform.sizeDelta = new Vector2(484.8f, 255f); Img_Town.transform.localPosition = new Vector3( Img_Town.transform.localPosition.x, -190, 0); break; case eStageKind.STAGE5: Img_Town.enabled = false; break; } #endregion // 몬스터 정보 저장 m_MonsterID = new int[ MainController.Instance.GetStageInfo( MainController.Instance.SelectStageKind).MonsterID.Length]; } // 능력 / 스킬 탭 설정 if (AdventureSceneManager.Instance != null) { //AdventureSceneManager.Instance.Tab_Group.SetUseable(1, false); } // 몬스터 랜덤 소환 for (int i = 0; i < m_MonsterID.Length; i++) { m_MonsterID[i] = MainController.Instance.GetStageInfo(MainController.Instance.SelectStageKind).MonsterID[i]; } m_MonsterInfo = new CharacterMonster[2]; // 0 : 진행, 1: 대기 FirstMonsterSummons(); StartCoroutine(CheckNowMonster()); // 용사 설정 m_HeroInfo.Initialize(); m_HeroInfo.Position_Damage = Position_Damage; m_HeroInfo.SetSkin(SetHeroAnimArmorSkinLevel(), SetHeroAnimSwordSkinLevel()); // 인 게임 일시정지 PauseInGamePlay(); // 카운트 다운 시작 StartCoroutine(StartCountDown()); }