public static void ShowExitDialogue(DialogClickHandler handler)
    {
//		Debug.Log("ShowExitDialogue");
        if (Instance.mDialogueBox == null)
        {
            GameObject prefab = Resources.Load("CommonDialogue") as GameObject;
            Instance.mDialogueBox = Instantiate(prefab, new Vector3(0f, 0f, 0f), Quaternion.identity) as GameObject;
        }

//		string strTitle = Instance.mDialogueBox.GetComponent<PlayMakerFSM> ().FsmVariables.FindFsmString ("exitTitle").Value;
//		string strBody = Instance.mDialogueBox.GetComponent<PlayMakerFSM> ().FsmVariables.FindFsmString ("exitBody").Value;

        string strTitle = UtilMgr.GetLocalText("StrExitTitle");
        string strBody  = UtilMgr.GetLocalText("StrExitBody");

        ShowDialogue(strTitle, strBody, DIALOGUE_TYPE.YesNo, null, null, null, handler);

//		Instance.mIsExit = true;
    }
Exemple #2
0
    public static void ShowExitDialogue(DialogClickHandler handler)
    {
//		Debug.Log("ShowExitDialogue");
        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;
//			}
        }

        string strTitle = Instance.mDialogueBox.GetComponent <PlayMakerFSM> ().FsmVariables.FindFsmString("exitTitle").Value;
        string strBody  = Instance.mDialogueBox.GetComponent <PlayMakerFSM> ().FsmVariables.FindFsmString("exitBody").Value;

        ShowDialogue(strTitle, strBody, DIALOGUE_TYPE.YesNo, null, null, null, handler);

//		Instance.mIsExit = true;
    }
 public void SetHandler(DialogClickHandler handler)
 {
     Instance.OnClickHandler = handler;// as OnClicked;
 }
    public static void ShowExitDialogue(DialogClickHandler handler)
    {
        //		Debug.Log("ShowExitDialogue");
        if (Instance.mDialogueBox == null) {
            GameObject prefab = Resources.Load ("CommonDialogue") as GameObject;
            Instance.mDialogueBox = Instantiate (prefab, new Vector3 (0f, 0f, 0f), Quaternion.identity) as GameObject;

        }

        //		string strTitle = Instance.mDialogueBox.GetComponent<PlayMakerFSM> ().FsmVariables.FindFsmString ("exitTitle").Value;
        //		string strBody = Instance.mDialogueBox.GetComponent<PlayMakerFSM> ().FsmVariables.FindFsmString ("exitBody").Value;

        string strTitle = UtilMgr.GetLocalText("StrExitTitle");
        string strBody = UtilMgr.GetLocalText("StrExitBody");

        ShowDialogue (strTitle, strBody, DIALOGUE_TYPE.YesNo, null, null, null, handler);

        //		Instance.mIsExit = true;
    }
    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;
    }
    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 void SetHandler(DialogClickHandler handler)
 {
     Instance.OnClickHandler = handler;        // as OnClicked;
 }
    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;
    }
    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;
    }
Exemple #12
0
    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;
    }