public static StateWinManager Get_Inctance() { if (instance == null) { instance = FindObjectOfType(typeof(StateWinManager)) as StateWinManager; } if (null == instance) { GameObject obj = new GameObject("StateWinManager "); instance = obj.AddComponent(typeof(StateWinManager)) as StateWinManager; Debug.Log("Fail to get Manager Instance"); } return(instance); }
IEnumerator C_StartState() { yield return(new WaitForSeconds(0.5f)); while (true) { Timer += Time.deltaTime; UIManager.Get_Inctance().Set_Time((int)Timer); // 게임 상황을 Update문으로 계속 확인한다. switch (GMstate) { case GMSTATE.IDLE: { break; } case GMSTATE.NEXT: { // 다음 장소로 가기 위해 Player들을 전부 대기상태로 한번 만들고 이동한다. PlayerManager.Get_Inctance().Set_Idle(); PlayerManager.Get_Inctance().Invoke("Set_Move", 0.6f); Now_Wave = 1; for (int i = 0; i < All_Wave; i++) { if (MonsterManager.Get_Inctance().transform.GetChild(i).GetComponent <BoxCollider>().enabled == false) { Now_Wave++; } } UIManager.Get_Inctance().Set_WaveUI(Now_Wave, All_Wave); GMstate = GMSTATE.IDLE; break; } case GMSTATE.BOSS: { PlayerManager.Get_Inctance().Set_Idle(); MonsterManager.Get_Inctance().Set_Idle(); GMstate = GMSTATE.IDLE; break; } case GMSTATE.WIN: { PlayerManager.Get_Inctance().Set_Off(); UIManager.Get_Inctance().Set_WinUI(); StateWinManager.Get_Inctance().View_UI(Timer, GameManager.Get_Inctance().Level, 50); GMstate = GMSTATE.IDLE; break; } case GMSTATE.FAILD: { MonsterManager.Get_Inctance().Set_Idle(); UIManager.Get_Inctance().Set_FaildUI(); break; } } float distance = Distance_Percent(PlayerStandPos, Boss.transform.position, PlayerManager.Get_Inctance().transform.position); UIManager.Get_Inctance().Set_Space(distance); if (distance > 0.85f && distance < 0.95f) { UIManager.Get_Inctance().Set_Warning(); } yield return(null); } }
// Use this for initialization void Awake() { instance = this; }