public static void ShowDialogue(string strTitle, string strBody, DIALOGUE_TYPE type, string strBtn1, string strBtn2, string strCancel, DialogClickHandler handler) { Instance.SetHandler(handler); if (Instance.mDialogueBox == null) { GameObject prefab = Resources.Load("CommonDialogue") as GameObject; Instance.mDialogueBox = Instantiate(prefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; } if (IsShown) { DialogueMgr.DismissDialogue(); } Instance.mDialogueBox.transform.parent = GameObject.Find("Camera").transform; Instance.mDialogueBox.transform.localScale = new Vector3(1f, 1f, 1f); Instance.mDialogueBox.transform.localPosition = new Vector3(0, 0, 1000f); Instance.mDialogueBox.SetActive(true); Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblTitle") .GetComponent <UILabel> ().text = strTitle; Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblBody") .GetComponent <UILabel> ().text = "[333333]" + strBody + "[-]"; int bodyHeight = Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblBody") .GetComponent <UILabel> ().height; Instance.SetTypeDialogue(type, strBtn1, strBtn2, strCancel, bodyHeight); IsShown = true; Instance.mDialogueBox.transform.FindChild("Box").localScale = new Vector3(0f, 0f, 0f); TweenScale.Begin(Instance.mDialogueBox.transform.FindChild("Box").gameObject, 0.5f, new Vector3(1f, 1f, 1f)); Instance.mDialogueBox.transform.FindChild("Box").GetComponent <UITweener>().method = UITweener.Method.BounceIn; }
public static void ShowDialogue(string strTitle, string strBody, DIALOGUE_TYPE type, string strBtn1, string strBtn2, string strCancel) { if (Instance.mDialogueBox == null) { GameObject prefab = Resources.Load("CommonDialogue") as GameObject; Instance.mDialogueBox = Instantiate(prefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; } if (IsShown) { DialogueMgr.DismissDialogue(); } Instance.mDialogueBox.transform.parent = GameObject.Find("UI Root").transform; Instance.mDialogueBox.transform.localScale = new Vector3(1f, 1f, 1f); Instance.mDialogueBox.transform.localPosition = new Vector3(0, 0, 0); Instance.mDialogueBox.SetActive(true); Instance.mDialogueBox.transform.FindChild("Panel").FindChild("LblTitle") .GetComponent <UILabel> ().text = strTitle; Instance.mDialogueBox.transform.FindChild("Panel").FindChild("LblBody") .GetComponent <UILabel> ().text = strBody; Instance.SetTypeDialogue(type, strBtn1, strBtn2, strCancel); // Instance.mIsExit = false; // UtilMgr.SetBackEvent(new EventDelegate(Instance.GetComponent<DialogueMgr>(), "DismissDialogue")); IsShown = true; }
public static void ShowDialogue(string strTitle, string strBody, DIALOGUE_TYPE type, string strBtn1, string strBtn2, string strCancel, DialogClickHandler handler) { Instance.SetHandler(handler); // Debug.Log("ShowDialogue2"); if (Instance.mDialogueBox == null) { //if(Application.loadedLevelName.Equals("SceneLobby")){ GameObject prefab = Resources.Load("CommonDialogue2") as GameObject; Instance.mDialogueBox = Instantiate(prefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; // }else{ // GameObject prefab = Resources.Load ("CommonDialogue") as GameObject; // Instance.mDialogueBox = Instantiate (prefab, new Vector3 (0f, 0f, 0f), Quaternion.identity) as GameObject; // } } if (IsShown) { DialogueMgr.DismissDialogue(); } Instance.mDialogueBox.transform.parent = GameObject.Find("Camera").transform; Instance.mDialogueBox.transform.localScale = new Vector3(1f, 1f, 1f); Instance.mDialogueBox.transform.localPosition = new Vector3(0, 0, 0); Instance.mDialogueBox.SetActive(true); Instance.mDialogueBox.transform.FindChild("Panel").FindChild("LblTitle") .GetComponent <UILabel> ().text = strTitle; Instance.mDialogueBox.transform.FindChild("Panel").FindChild("LblBody") .GetComponent <UILabel> ().text = "[565656]" + strBody + "[-]"; Instance.SetTypeDialogue(type, strBtn1, strBtn2, strCancel); // Instance.mIsExit = false; // UtilMgr.SetBackEvent(new EventDelegate(Instance.GetComponent<DialogueMgr>(), "DismissDialogue")); IsShown = true; }
void SetTypeDialogue(DIALOGUE_TYPE type, string strBtn1, string strBtn2, string strCancel, int bodyHeight) { Instance.mDialogueBox.transform.FindChild("Box").FindChild("SprBG").gameObject.SetActive(true); Instance.mDialogueBox.transform.FindChild("Box").FindChild("SprBG").GetComponent<UISprite>().height = 260 + bodyHeight; Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert").gameObject.SetActive(false); Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert").localPosition = new Vector3(0f, -86f-(bodyHeight/2f), 0f); Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo").gameObject.SetActive(false); Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo").localPosition = new Vector3(0f, -86f-(bodyHeight/2f), 0f); Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblTitle").localPosition = new Vector3(0f, 60f+(bodyHeight/2f), 0f); Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblBody").localPosition // = new Vector3(0f, 0f+(bodyHeight/2f), 0f); = new Vector3(0f, 0f, 0f); if (type == DIALOGUE_TYPE.Alert) { Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert").gameObject.SetActive(true); if (strCancel == null || strCancel.Length < 1) strCancel = UtilMgr.GetLocalText("StrConfirm"); Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert") .FindChild ("BtnCancel").FindChild("Label").GetComponent<UILabel> ().text = strCancel; // btnCancel.transform.localPosition = new Vector3 (0, -100f, 0); } else if (type == DIALOGUE_TYPE.YesNo) { Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo").gameObject.SetActive(true); if (strBtn1 == null || strBtn1.Length < 1) strBtn1 = UtilMgr.GetLocalText("StrConfirm"); if (strCancel == null || strCancel.Length < 1) strCancel = UtilMgr.GetLocalText("StrCancel"); Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo") .FindChild ("Btn1").FindChild ("Label").GetComponent<UILabel> ().text = strBtn1; Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo") .FindChild ("BtnCancel").FindChild ("Label").GetComponent<UILabel> ().text = strCancel; } // else if (type == DIALOGUE_TYPE.Choose) { // btn1.SetActive (true); // btn2.SetActive (true); // btnCancel.SetActive (true); // // btn1.transform.FindChild ("Label").GetComponent<UILabel> ().text = strBtn1; // btn2.transform.FindChild ("Label").GetComponent<UILabel> ().text = strBtn2; // btnCancel.transform.FindChild ("Label").GetComponent<UILabel> ().text = strCancel; // // btn2.transform.localPosition = new Vector3 (0, -100f, 0); // btn1.transform.localPosition = new Vector3 (-190f, -100f, 0); // btnCancel.transform.localPosition = new Vector3 (190f, -100f, 0); // } else if (type == DIALOGUE_TYPE.EventAlert_NonBg) { // SprBG.SetActive (false); // btn1.SetActive (false); // btn2.SetActive (false); // btnCancel.SetActive (true); // // strCancel = fsmVariables.FindFsmString ("strAlert").Value; // // btnCancel.transform.FindChild ("Label").GetComponent<UILabel> ().text = strCancel; // btnCancel.transform.localPosition = new Vector3 (0, -100f, 0); // } else if (type == DIALOGUE_TYPE.EventAlert) { // btn1.SetActive (false); // btn2.SetActive (false); // btnCancel.SetActive (true); // // strCancel = fsmVariables.FindFsmString ("strAlert").Value; // // btnCancel.transform.FindChild ("Label").GetComponent<UILabel> ().text = strCancel; // btnCancel.transform.localPosition = new Vector3 (0, -100f, 0); // } }
public static void ShowDialogue(string strTitle, string strBody, DIALOGUE_TYPE type, string strBtn1, string strBtn2, string strCancel, DialogClickHandler handler) { Instance.SetHandler(handler); if (Instance.mDialogueBox == null) { GameObject prefab = Resources.Load ("CommonDialogue") as GameObject; Instance.mDialogueBox = Instantiate (prefab, new Vector3 (0f, 0f, 0f), Quaternion.identity) as GameObject; } if (IsShown) { DialogueMgr.DismissDialogue(); } Instance.mDialogueBox.transform.parent = GameObject.Find ("Camera").transform; Instance.mDialogueBox.transform.localScale = new Vector3(1f, 1f, 1f); Instance.mDialogueBox.transform.localPosition = new Vector3(0, 0, 1000f); Instance.mDialogueBox.SetActive (true); Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblTitle") .GetComponent<UILabel> ().text = strTitle; Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblBody") .GetComponent<UILabel> ().text = "[333333]"+strBody+"[-]"; int bodyHeight = Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblBody") .GetComponent<UILabel> ().height; Instance.SetTypeDialogue (type, strBtn1, strBtn2, strCancel, bodyHeight); IsShown = true; Instance.mDialogueBox.transform.FindChild("Box").localScale = new Vector3(0f, 0f, 0f); TweenScale.Begin(Instance.mDialogueBox.transform.FindChild("Box").gameObject, 0.5f, new Vector3(1f, 1f, 1f)); Instance.mDialogueBox.transform.FindChild("Box").GetComponent<UITweener>().method = UITweener.Method.BounceIn; }
public static void ShowDialogue(string strTitle, string strBody, DIALOGUE_TYPE type, DialogClickHandler handler) { // Debug.Log("ShowDialogue1"); ShowDialogue(strTitle, strBody, type, null, null, null, handler); }
public static void ShowAttendanceDialogue(DIALOGUE_TYPE type, DialogClickHandler handler) { LoginInfo info = UserMgr.LoginInfo; GameObject prefab = Resources.Load ("Attendance") as GameObject; Instance.mAttendanceBox = Instantiate (prefab, new Vector3 (0f, 0f, 0f), Quaternion.identity) as GameObject; Instance.SetHandler(handler); if (IsShown) { DialogueMgr.DismissDialogue(); } Instance.mAttendanceBox.transform.parent = GameObject.Find ("Camera").transform; Instance.mAttendanceBox.transform.localScale = new Vector3(1f, 1f, 1f); Instance.mAttendanceBox.transform.localPosition = new Vector3(0, 0, 1000f); Instance.mAttendanceBox.SetActive (true); if(type == DIALOGUE_TYPE.Attendance){ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblAttendanceBonus").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblMembershipBonus").gameObject.SetActive(false); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Welcome").gameObject.SetActive(false); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("LblDailyAttendanceBonus") .localPosition = new Vector3(0, 70f); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("LblAttendanceDesc") .localPosition = new Vector3(0, -260f); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("LblYouGotAll").localPosition = new Vector3(0, -180f); // for(int i = 0; i < 7; i++){ // Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("Box") // .FindChild(""+(i+1)).gameObject.SetActive(false); // } // // for(int i = 0; i < info.attendDay; i++){ // Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("Box") // .FindChild(""+(i+1)).gameObject.SetActive(true); // } if(info.freeTicket > 0){ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").FindChild("Sprite") .FindChild("Label").GetComponent<UILabel>().text = info.freeTicket + " " + UtilMgr.GetLocalText("LblTickets"); } else Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(false); if(info.freeGold > 0){ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").FindChild("Sprite") .FindChild("Label").GetComponent<UILabel>().text = info.freeGold + " " + UtilMgr.GetLocalText("LblGold"); } else Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(false); if(info.freeItem != null && info.freeItem.Length > 0){ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").FindChild("Sprite") .FindChild("Label").GetComponent<UILabel>().text = info.freeItem; } else Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(false); } else{ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblAttendanceBonus").gameObject.SetActive(false); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblMembershipBonus").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Welcome").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").gameObject.SetActive(false); if(info.joinFreeTicket > 0){ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").FindChild("Sprite") .FindChild("Label").GetComponent<UILabel>().text = info.freeGold + " " + UtilMgr.GetLocalText("LblTickets"); } else Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(false); if(info.joinFreeGold > 0){ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").FindChild("Sprite") .FindChild("Label").GetComponent<UILabel>().text = info.joinFreeGold + " " + UtilMgr.GetLocalText("LblGold"); } else Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(false); if(info.joinFreeItem != null && info.joinFreeItem.Length > 0){ Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").FindChild("Sprite") .FindChild("Label").GetComponent<UILabel>().text = info.joinFreeItem; } else Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(false); } IsShown = true; Instance.mAttendanceBox.transform.FindChild("Box").localScale = new Vector3(0f, 0f, 0f); TweenScale.Begin(Instance.mAttendanceBox.transform.FindChild("Box").gameObject, 0.5f, new Vector3(1f, 1f, 1f)); Instance.mAttendanceBox.transform.FindChild("Box").GetComponent<UITweener>().method = UITweener.Method.BounceIn; }
void SetTypeDialogue(DIALOGUE_TYPE type, string strBtn1, string strBtn2, string strCancel, int bodyHeight) { Instance.mDialogueBox.transform.FindChild("Box").FindChild("SprBG").gameObject.SetActive(true); Instance.mDialogueBox.transform.FindChild("Box").FindChild("SprBG").GetComponent <UISprite>().height = 260 + bodyHeight; Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert").gameObject.SetActive(false); Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert").localPosition = new Vector3(0f, -86f - (bodyHeight / 2f), 0f); Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo").gameObject.SetActive(false); Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo").localPosition = new Vector3(0f, -86f - (bodyHeight / 2f), 0f); Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblTitle").localPosition = new Vector3(0f, 60f + (bodyHeight / 2f), 0f); Instance.mDialogueBox.transform.FindChild("Box").FindChild("LblBody").localPosition // = new Vector3(0f, 0f+(bodyHeight/2f), 0f); = new Vector3(0f, 0f, 0f); if (type == DIALOGUE_TYPE.Alert) { Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert").gameObject.SetActive(true); if (strCancel == null || strCancel.Length < 1) { strCancel = UtilMgr.GetLocalText("StrConfirm"); } Instance.mDialogueBox.transform.FindChild("Box").FindChild("Alert") .FindChild("BtnCancel").FindChild("Label").GetComponent <UILabel> ().text = strCancel; // btnCancel.transform.localPosition = new Vector3 (0, -100f, 0); } else if (type == DIALOGUE_TYPE.YesNo) { Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo").gameObject.SetActive(true); if (strBtn1 == null || strBtn1.Length < 1) { strBtn1 = UtilMgr.GetLocalText("StrConfirm"); } if (strCancel == null || strCancel.Length < 1) { strCancel = UtilMgr.GetLocalText("StrCancel"); } Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo") .FindChild("Btn1").FindChild("Label").GetComponent <UILabel> ().text = strBtn1; Instance.mDialogueBox.transform.FindChild("Box").FindChild("YesNo") .FindChild("BtnCancel").FindChild("Label").GetComponent <UILabel> ().text = strCancel; } // else if (type == DIALOGUE_TYPE.Choose) { // btn1.SetActive (true); // btn2.SetActive (true); // btnCancel.SetActive (true); // // btn1.transform.FindChild ("Label").GetComponent<UILabel> ().text = strBtn1; // btn2.transform.FindChild ("Label").GetComponent<UILabel> ().text = strBtn2; // btnCancel.transform.FindChild ("Label").GetComponent<UILabel> ().text = strCancel; // // btn2.transform.localPosition = new Vector3 (0, -100f, 0); // btn1.transform.localPosition = new Vector3 (-190f, -100f, 0); // btnCancel.transform.localPosition = new Vector3 (190f, -100f, 0); // } else if (type == DIALOGUE_TYPE.EventAlert_NonBg) { // SprBG.SetActive (false); // btn1.SetActive (false); // btn2.SetActive (false); // btnCancel.SetActive (true); // // strCancel = fsmVariables.FindFsmString ("strAlert").Value; // // btnCancel.transform.FindChild ("Label").GetComponent<UILabel> ().text = strCancel; // btnCancel.transform.localPosition = new Vector3 (0, -100f, 0); // } else if (type == DIALOGUE_TYPE.EventAlert) { // btn1.SetActive (false); // btn2.SetActive (false); // btnCancel.SetActive (true); // // strCancel = fsmVariables.FindFsmString ("strAlert").Value; // // btnCancel.transform.FindChild ("Label").GetComponent<UILabel> ().text = strCancel; // btnCancel.transform.localPosition = new Vector3 (0, -100f, 0); // } }
public static void ShowAttendanceDialogue(DIALOGUE_TYPE type, DialogClickHandler handler) { LoginInfo info = UserMgr.LoginInfo; GameObject prefab = Resources.Load("Attendance") as GameObject; Instance.mAttendanceBox = Instantiate(prefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject; Instance.SetHandler(handler); if (IsShown) { DialogueMgr.DismissDialogue(); } Instance.mAttendanceBox.transform.parent = GameObject.Find("Camera").transform; Instance.mAttendanceBox.transform.localScale = new Vector3(1f, 1f, 1f); Instance.mAttendanceBox.transform.localPosition = new Vector3(0, 0, 1000f); Instance.mAttendanceBox.SetActive(true); if (type == DIALOGUE_TYPE.Attendance) { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblAttendanceBonus").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblMembershipBonus").gameObject.SetActive(false); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Welcome").gameObject.SetActive(false); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("LblDailyAttendanceBonus") .localPosition = new Vector3(0, 70f); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("LblAttendanceDesc") .localPosition = new Vector3(0, -260f); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("LblYouGotAll").localPosition = new Vector3(0, -180f); // for(int i = 0; i < 7; i++){ // Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("Box") // .FindChild(""+(i+1)).gameObject.SetActive(false); // } // // for(int i = 0; i < info.attendDay; i++){ // Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").FindChild("Box") // .FindChild(""+(i+1)).gameObject.SetActive(true); // } if (info.freeTicket > 0) { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").FindChild("Sprite") .FindChild("Label").GetComponent <UILabel>().text = info.freeTicket + " " + UtilMgr.GetLocalText("LblTickets"); } else { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(false); } if (info.freeGold > 0) { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").FindChild("Sprite") .FindChild("Label").GetComponent <UILabel>().text = info.freeGold + " " + UtilMgr.GetLocalText("LblGold"); } else { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(false); } if (info.freeItem != null && info.freeItem.Length > 0) { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").FindChild("Sprite") .FindChild("Label").GetComponent <UILabel>().text = info.freeItem; } else { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(false); } } else { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblAttendanceBonus").gameObject.SetActive(false); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Top").FindChild("LblMembershipBonus").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Welcome").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Attendance").gameObject.SetActive(false); if (info.joinFreeTicket > 0) { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").FindChild("Sprite") .FindChild("Label").GetComponent <UILabel>().text = info.freeGold + " " + UtilMgr.GetLocalText("LblTickets"); } else { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Ticket").gameObject.SetActive(false); } if (info.joinFreeGold > 0) { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").FindChild("Sprite") .FindChild("Label").GetComponent <UILabel>().text = info.joinFreeGold + " " + UtilMgr.GetLocalText("LblGold"); } else { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Gold").gameObject.SetActive(false); } if (info.joinFreeItem != null && info.joinFreeItem.Length > 0) { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(true); Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").FindChild("Sprite") .FindChild("Label").GetComponent <UILabel>().text = info.joinFreeItem; } else { Instance.mAttendanceBox.transform.FindChild("Box").FindChild("Mid").FindChild("Pack").gameObject.SetActive(false); } } IsShown = true; Instance.mAttendanceBox.transform.FindChild("Box").localScale = new Vector3(0f, 0f, 0f); TweenScale.Begin(Instance.mAttendanceBox.transform.FindChild("Box").gameObject, 0.5f, new Vector3(1f, 1f, 1f)); Instance.mAttendanceBox.transform.FindChild("Box").GetComponent <UITweener>().method = UITweener.Method.BounceIn; }
void SetTypeDialogue(DIALOGUE_TYPE type, string strBtn1, string strBtn2, string strCancel) { GameObject btn1 = Instance.mDialogueBox.transform.FindChild("Panel").FindChild("Btn1").gameObject; GameObject btn2 = Instance.mDialogueBox.transform.FindChild("Panel").FindChild("Btn2").gameObject; GameObject btnCancel = Instance.mDialogueBox.transform.FindChild("Panel").FindChild("BtnCancel").gameObject; GameObject SprBG = Instance.mDialogueBox.transform.FindChild("Panel").FindChild("SprBG").gameObject; SprBG.SetActive(true); HutongGames.PlayMaker.FsmVariables fsmVariables = Instance.mDialogueBox.GetComponent <PlayMakerFSM> ().FsmVariables; if (strBtn1 == null || strBtn1.Length < 1) { strBtn1 = fsmVariables.FindFsmString("strBtn1").Value; } if (strBtn2 == null || strBtn2.Length < 1) { strBtn2 = ""; } if (strCancel == null || strCancel.Length < 1) { strCancel = fsmVariables.FindFsmString("strCancel").Value; } if (type == DIALOGUE_TYPE.Alert) { btn1.SetActive(false); btn2.SetActive(false); btnCancel.SetActive(true); strCancel = fsmVariables.FindFsmString("strAlert").Value; btnCancel.transform.FindChild("Label").GetComponent <UILabel> ().text = strCancel; btnCancel.transform.localPosition = new Vector3(0, -100f, 0); } else if (type == DIALOGUE_TYPE.YesNo) { btn1.SetActive(true); btn2.SetActive(false); btnCancel.SetActive(true); btn1.transform.FindChild("Label").GetComponent <UILabel> ().text = strBtn1; btnCancel.transform.FindChild("Label").GetComponent <UILabel> ().text = strCancel; btn1.transform.localPosition = new Vector3(-145f, -100f, 0); btnCancel.transform.localPosition = new Vector3(145f, -100f, 0); } else if (type == DIALOGUE_TYPE.Choose) { btn1.SetActive(true); btn2.SetActive(true); btnCancel.SetActive(true); btn1.transform.FindChild("Label").GetComponent <UILabel> ().text = strBtn1; btn2.transform.FindChild("Label").GetComponent <UILabel> ().text = strBtn2; btnCancel.transform.FindChild("Label").GetComponent <UILabel> ().text = strCancel; btn2.transform.localPosition = new Vector3(0, -100f, 0); btn1.transform.localPosition = new Vector3(-190f, -100f, 0); btnCancel.transform.localPosition = new Vector3(190f, -100f, 0); } else if (type == DIALOGUE_TYPE.EventAlert_NonBg) { SprBG.SetActive(false); btn1.SetActive(false); btn2.SetActive(false); btnCancel.SetActive(true); strCancel = fsmVariables.FindFsmString("strAlert").Value; btnCancel.transform.FindChild("Label").GetComponent <UILabel> ().text = strCancel; btnCancel.transform.localPosition = new Vector3(0, -100f, 0); } else if (type == DIALOGUE_TYPE.EventAlert) { btn1.SetActive(false); btn2.SetActive(false); btnCancel.SetActive(true); strCancel = fsmVariables.FindFsmString("strAlert").Value; btnCancel.transform.FindChild("Label").GetComponent <UILabel> ().text = strCancel; btnCancel.transform.localPosition = new Vector3(0, -100f, 0); } }