コード例 #1
0
ファイル: TransPage.cs プロジェクト: bufang-master/Adventure
        public void OnBtnTrans()
        {
            AudioControl.PlayEffect(GameDef.clickEffect);

            if (ud.food < ud.stat_num[4])
            {
                UIAPI.ShowMsgBox("食物不足", "背包未装满食物,请备满食物再前往冒险世界?", "确定", delegate(object arg) {
                    GuideAPI.BuyFoodFunc();
                });
            }
            else
            {
                if (btn[0])
                {
                    if (btn[1])
                    {
                        if (btn[2])
                        {
                            //天地人
                            ud.mapPath = "200|200";
                            ud.BOSSID  = 15;
                        }
                        else
                        {
                            //天地
                            ud.mapPath = "150|150";
                            ud.BOSSID  = 14;
                        }
                    }
                    else
                    {
                        if (btn[2])
                        {
                            //天人
                            ud.mapPath = "150|150";
                            ud.BOSSID  = 14;
                        }
                        else
                        {
                            //天
                            ud.mapPath = "100|100";
                            ud.BOSSID  = 13;
                        }
                    }
                }
                else
                {
                    if (btn[1])
                    {
                        if (btn[2])
                        {
                            //地人
                            ud.mapPath = "150|150";
                            ud.BOSSID  = 14;
                        }
                        else
                        {
                            //地
                            ud.mapPath = "100|100";
                            ud.BOSSID  = 13;
                        }
                    }
                    else
                    {
                        if (btn[2])
                        {
                            //人
                            ud.mapPath = "100|100";
                            ud.BOSSID  = 13;
                        }
                        else
                        {
                            //无
                            ud.mapPath = "map/mapData/text";
                            ud.BOSSID  = 12;
                        }
                    }
                }
                ud.food -= (uint)ud.stat_num[4];
                AppConfig.Value.mainUserData = ud;
                AppConfig.Save();
                UIManager.MainScene = "Adventure";
                SceneManager.LoadScene("Loading");
            }
        }