Exemplo n.º 1
0
 public void quitGame()
 {
     mainDoc.UserQuit();
 }
Exemplo n.º 2
0
    public void showAward(int rank, string awardInfoStr)
    {
        hideAnima();
        if (IsInvoking("delayShowTips"))
        {
            CancelInvoke("delayShowTips");
        }
        tipSpt.gameObject.SetActive(false);
        blackBg.SetActive(false);
        if (PlatformGameDefine.game.GameTypeIDs == "9" || PlatformGameDefine.game.GameTypeIDs == "8")
        {
            dailyAwardPrb = SimpleFramework.Util.LoadAsset("GameDDZC/award131", "awardPanel131") as GameObject;
            GameObject award131Panel = Instantiate <GameObject>(dailyAwardPrb);
            award131Panel.transform.parent = transform;
            award131Panel.transform.Find("title/myrank").GetComponent <UILabel>().text = "第" + rank + "名";
                        #if UNITY_STANDALONE_WIN
            award131Panel.transform.FindChild("nickName").GetComponent <UILabel>().text = mainCls._userNickname.text + " :";
                        #else
            award131Panel.transform.Find("nickName").GetComponent <UILabel>().text = EginUser.Instance.nickname + " :";
                        #endif
            UIButton quitBtn3 = award131Panel.transform.Find("quit3").GetComponent <UIButton>();
            UIButton quitBtn2 = award131Panel.transform.Find("quit2").GetComponent <UIButton>();
            UIButton quitBtn1 = award131Panel.transform.Find("quit1").GetComponent <UIButton>();
            if (rank == 1)
            {
                if (PlatformGameDefine.game.GameTypeIDs == "8")
                {
                    quitBtn3.gameObject.SetActive(false);
                    quitBtn2.gameObject.SetActive(true);
                    quitBtn1.gameObject.SetActive(true);
                    quitBtn2.onClick.Add(new EventDelegate(() => { mainCls.UserQuit(); }));
                    quitBtn1.onClick.Add(new EventDelegate(() => { mainCls.btnHandleRgt(); }));
                    award131Panel.transform.Find("bonus").GetComponent <UILabel>().text = "日赛门票一张";
                }
                else
                {
                    quitBtn3.onClick.Add(new EventDelegate(() => { mainCls.UserQuit(); }));
                    award131Panel.transform.Find("bonus").GetComponent <UILabel>().text = awardInfoStr;
                    award131Panel.transform.Find("tips").gameObject.SetActive(false);
                }
            }
            else
            {
                if (PlatformGameDefine.game.GameTypeIDs == "8")
                {
                    quitBtn3.gameObject.SetActive(false);
                    quitBtn2.gameObject.SetActive(true);
                    quitBtn1.gameObject.SetActive(true);
                    quitBtn2.onClick.Add(new EventDelegate(() => { mainCls.UserQuit(); }));
                    quitBtn1.onClick.Add(new EventDelegate(() => { mainCls.btnHandleRgt(); }));
                    award131Panel.GetComponent <UISprite>().spriteName = "131awardFrame1";
                    award131Panel.GetComponent <UISprite>().MakePixelPerfect();
                    award131Panel.transform.Find("title").localPosition = new Vector3(-159, -6, 0);
                    award131Panel.transform.Find("title").GetComponent <UILabel>().text = "恭喜你赢得游戏大咖海选赛                                  再接再厉。";
                    award131Panel.transform.Find("bonus").GetComponent <UILabel>().text = "";
                    award131Panel.transform.Find("des").gameObject.SetActive(false);
                    award131Panel.transform.Find("tips").gameObject.SetActive(false);
                }
                else
                {
                    quitBtn3.onClick.Add(new EventDelegate(() => { mainCls.UserQuit(); }));
                    if (rank > 10)
                    {
                        award131Panel.GetComponent <UISprite>().spriteName = "131awardFrame1";
                        award131Panel.GetComponent <UISprite>().MakePixelPerfect();
                        award131Panel.transform.Find("title").localPosition = new Vector3(-159, -6, 0);
                        award131Panel.transform.Find("bonus").GetComponent <UILabel>().text = "";
                        award131Panel.transform.Find("des").gameObject.SetActive(false);
                        award131Panel.transform.Find("tips").gameObject.SetActive(false);
                        award131Panel.transform.Find("title").GetComponent <UILabel>().text = "恭喜你赢得游戏大咖日赛                                  再接再厉。";
                    }
                    else
                    {
                        award131Panel.transform.Find("bonus").GetComponent <UILabel>().text = awardInfoStr;
                        award131Panel.transform.Find("tips").gameObject.SetActive(false);
                    }
                }
            }
            award131Panel.transform.localScale    = Vector3.one;
            award131Panel.transform.localPosition = new Vector3(0, -67.89f, 0);


            iTween.ScaleFrom(award131Panel, iTween.Hash("scale", new Vector3(0.7f, 0.7f, 1.0f), "time", 0.3f,
                                                        "easetype", iTween.EaseType.easeOutBack));
        }
        else
        {
            awardObj.SetActive(true);
            gameNameLb.text = getGameName();
            if (PlatformGameDefine.game.GameTypeIDs == "6")
            {
                matchNameLb.text = "恭喜你在     斗地主5分钟赛";
            }
            else if (PlatformGameDefine.game.GameTypeIDs == "4")
            {
                matchNameLb.text = "恭喜你在     斗地主整点赛";
            }
            else if (PlatformGameDefine.game.GameTypeIDs == "7")
            {
                matchNameLb.text = "恭喜你在     斗地主三人赛";
            }
            else if (PlatformGameDefine.game.GameTypeIDs == "8")
            {
                matchNameLb.text = "恭喜你在     斗地主六人赛";
            }
            else if (PlatformGameDefine.game.GameTypeIDs == "9")
            {
                matchNameLb.text = "恭喜你在     斗地主日赛";
            }
            rankLb.text = rank + "";

                        #if UNITY_STANDALONE_WIN
            nickNameLb.text = mainCls._userNickname.text;
                        #else
            nickNameLb.text = EginUser.Instance.nickname;
                        #endif
            awardInfoLb.text = awardInfoStr;
            //		yield return new WaitForSeconds(0.5f);
            if (awardInfoStr.Length == 0)
            {
                awardDesLb.text = "中获得第          名的成绩。";
                res1L.atlas.spriteMaterial.SetFloat("_Saturation", 0.2f);
                comeonTag.SetActive(true);
            }
            else
            {
                awardDesLb.text = "中获得第          名的成绩。特为你派发如下奖品——";
                res1L.atlas.spriteMaterial.SetFloat("_Saturation", 1);
                comeonTag.SetActive(false);
            }
            awardObj.transform.localScale = Vector3.one;
            iTween.ScaleFrom(awardObj, iTween.Hash("scale", new Vector3(0.7f, 0.7f, 1.0f), "time", 0.3f,
                                                   "easetype", iTween.EaseType.easeOutBack));
        }
    }