//활성화되어 있는 패널이 뒤로 갈때의 효과 public void ActivePanelBack(E_ACTIVEBUTTON _button, bool _isback) { StartCoroutine(fadeInOut.FadeInOutOnce(_button, _isback)); }
IEnumerator MainSceneInit() { yield return(new WaitForSeconds(0.1f)); //페이드 인 아웃 효과를 위한 할당 fadeInOut = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_FADEPANEL).GetComponent <FadeInOut>(); fadeInOut.mainMenuSceneManager = this; //버튼 할당 for (int i = 0; i < 12; i++) { activeButton[i] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_ACTIVEBUTTON).GetChild(i).GetComponent <Button>(); } //Active될 panel Object 할당(버튼) //치료소 activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_HEALING] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_MERCENARYHEAL).gameObject; //훈련소 activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_TRAINNING] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_MERCENARYTRAINNING).gameObject; //용병 고용소 activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_EMPLOYMENT] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_MERCENARYEMPLOY).gameObject; //스테이지 activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_STAGE] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_STAGE).gameObject; //우편 activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_POST] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_POST).gameObject; //달력 activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_CALENDER] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_CALENDER).gameObject; //가방 activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_INVEN] = canvas.transform.GetChild((int)E_CANVAS_UI_ORDER.E_CANVAS_UI_INVENTORY).gameObject; //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //해당 버튼에 따른 function 할당 //Mercenary Manage(용병관리) activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_MERCENARY_MANAGEMENT].onClick.AddListener(() => GameManager.Instance.LoadScene(ReadOnlys.E_SCENE_INDEX.E_MERMANAGE, E_SCENE_INDEX.E_MENU, true)); //치료소 activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_HEALING].onClick.AddListener(() => StartCoroutine(fadeInOut.FadeInOutOnce(E_ACTIVEBUTTON.E_ACTIVEBUTTON_HEALING, false))); //훈련소 activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_TRAINNING].onClick.AddListener(() => StartCoroutine(fadeInOut.FadeInOutOnce(E_ACTIVEBUTTON.E_ACTIVEBUTTON_TRAINNING, false))); //용병고용 activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_EMPLOYMENT].onClick.AddListener(() => StartCoroutine(fadeInOut.FadeInOutOnce(E_ACTIVEBUTTON.E_ACTIVEBUTTON_EMPLOYMENT, false))); //가방 activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_INVEN].onClick.AddListener(() => StartCoroutine(fadeInOut.FadeInOutOnce(E_ACTIVEBUTTON.E_ACTIVEBUTTON_INVEN, false))); //스테이지 activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_STAGE].onClick.AddListener(() => StartCoroutine(fadeInOut.FadeInOutOnce(E_ACTIVEBUTTON.E_ACTIVEBUTTON_STAGE, false))); //우편 activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_POST].onClick.AddListener(() => ActivePanelNoEffect(activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_POST], E_ACTIVEBUTTON.E_ACTIVEBUTTON_POST)); postExpression = activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_POST].transform.GetChild(0).gameObject; //용병고용 //activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_SHOP].onClick.AddListener(() => StartCoroutine(fadeInOut.FadeInOutOnce(E_ACTIVEBUTTON.E_ACTIVEBUTTON_TRAINNING, false))); //달력 activeButton[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_CALENDER].onClick.AddListener(() => ActivePanelNoEffect(activeButtonPanel[(int)E_ACTIVEBUTTON.E_ACTIVEBUTTON_CALENDER], E_ACTIVEBUTTON.E_ACTIVEBUTTON_CALENDER)); //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //ObjectPool 할당 for (E_MAINSCENE_OBJECTPOOL objectPool = 0; (int)objectPool < 2; objectPool++) { switch (objectPool) { case E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTSLOT: simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTSLOT].strPrefabName = "PostSlot"; simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTSLOT].prefab = simpleObjectpools[0].gameObject.transform.GetChild(0).gameObject; simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTSLOT].PreloadPool(); simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTSLOT].nPoolSize = 20; //유동적으로 바뀔수 있음. postPanel.m_PostSimpleObject = simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTSLOT]; break; case E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTGETSLOT: simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTGETSLOT].strPrefabName = "PostGetSlot"; simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTGETSLOT].prefab = simpleObjectpools[1].gameObject.transform.GetChild(0).gameObject; simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTGETSLOT].PreloadPool(); simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTGETSLOT].nPoolSize = 20; postGetPanel.m_PostGetSimpleObject = simpleObjectpools[(int)E_MAINSCENE_OBJECTPOOL.E_MAINSCENE_OBJECTPOOL_POSTGETSLOT]; break; default: break; } } //우편 체크 postPanel.postGetPanel = postGetPanel; //우편 체크 표시 활성화 if (GameManager.Instance.GetPlayer().mail != null) { postExpression.SetActive(true); } }