Пример #1
0
    void OnsetBtnClick()
    {
        //PlaySE
        MusicManager.PlaySe("click");
        //UI:BGM SE(Global)
        set.SetActive(true);

        bgmSlider   = UIManager.GetSlider("bgmSlider");
        seSlider    = UIManager.GetSlider("seSlider");
        voiceSlider = UIManager.GetSlider("voiceSlider");

        bgmSlider.onValueChanged.AddListener(delegate { OnBgmSliderChange(); });
        seSlider.onValueChanged.AddListener(delegate { OnSeSliderChange(); });
        voiceSlider.onValueChanged.AddListener(delegate { OnVoiceSliderChange(); });

        bgmSlider.value   = Globals.bgmVolume;
        seSlider.value    = Globals.seVolume;
        voiceSlider.value = Globals.voiceVolume;

        closeSetBtn = set.transform.Find("closeSetBtn").GetComponent <Button>();
        closeSetBtn.onClick.AddListener(OncloseSetBtnClick);

        UIManager.GetButton("backBtn").onClick.AddListener(() =>
        {
            BattleGlobals.selectHeroes.Clear();
            GameFuncs.GoToSceneAsync("Main");
        });
    }
Пример #2
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (i < Globals.dialogs.Count - 1)
     {
         UIManager.ChangeText("context", "");
         Globals.logIndex = i;
         ChatFuncs.Instance.ShowDialog(i);
         i++;
     }
     else
     {
         if (Globals.lastScene == "Login")
         {
             Globals.nextScene = "Main";
         }
         if (Globals.lastScene == "Room")
         {
             GameFuncs.GoToScene("Room");
         }
         else
         {
             GameFuncs.GoToSceneAsync(Globals.nextScene);
         }
     }
 }
Пример #3
0
    public static void ShowLosePanel()
    {
        MusicManager.StopBgm();
        losePanel.SetActive(true);
        tip.SetActive(true);
        Transform lose = losePanel.transform;

        losePanel.GetComponent <Button>().onClick.AddListener(() =>
                                                              { GameFuncs.GoToSceneAsync("Main"); });
        BattleGlobals.selectHeroes.Clear();
    }
Пример #4
0
    void OnboardBtnClick(string boardStr)
    {
        switch (SceneManager.GetActiveScene().name)
        {
        case "Main":
            GameFuncs.GoToSceneAsync(boardStr);
            break;

        case "Summon":
            break;

        default:
            break;
        }
    }
Пример #5
0
 void OnskipBtnClick()
 {
     //PlaySE
     MusicManager.PlaySe("click");
     //Go to next scene(stop at options)
     if (Globals.lastScene == "Login")
     {
         Globals.nextScene = "Main";
     }
     if (Globals.lastScene == "Room")
     {
         GameFuncs.GoToScene("Room");
     }
     else
     {
         GameFuncs.GoToSceneAsync(Globals.nextScene);
     }
 }
Пример #6
0
    void OnloginBtnClick()
    {
        nameStr = UIManager.GetInputStr("nameInput");
        pwdStr  = UIManager.GetInputStr("pwdInput");
        //PlaySE
        MusicManager.PlaySe("click");;
        //Formal
        //Globals.isFirst = DBFuncs.FindSingle<int>("Players", "isFirst");
        if (nameStr == "" || pwdStr == "")
        {
            GameFuncs.CreateMsg("用户名或密码不能为空!");
            return;
        }
        else
        {
            if (DBFuncs.FindPlayer(nameStr, pwdStr))
            {
                //Enter Loading->Chat/Main
                if (Globals.player.isFirst)
                {
                    Globals.player.isFirst = false;
                    //Test
                    Globals.currentDialog = "test";

                    Globals.nextScene = "Main";
                    GameFuncs.GoToSceneAsync("Chat");
                }
                else
                {
                    //Load Globals.items&Globals.heroes
                    GameFuncs.GoToSceneAsync("Main");
                }
            }
            else
            {
                //弹出对话框"用户名或密码错误!"
                GameFuncs.CreateMsg("用户名或密码错误!");
            }
        }
    }
Пример #7
0
    public static void ShowWinPanel()
    {
        //BattleGlobals.selectHeroes.Clear();
        //foreach (Transform t in Battle.hpoints)
        //{
        //    foreach (Transform h in t)
        //    {
        //        string hid = h.gameObject.name.Substring(0, 3);
        //        BattleGlobals.selectHeroes.Add(hid);
        //    }
        //}
        winPanel.SetActive(true);
        tip.SetActive(true);
        getsBtn.SetActive(true);
        Transform win = winPanel.transform;

        winPanel.GetComponent <Button>().onClick.AddListener(() => { GameFuncs.GoToSceneAsync("Main"); });
        Transform grid = win.Find("winGrid");

        //gets
        getsBtn.GetComponent <Button>().onClick.AddListener(OngetsBtnClick);
        //create heroWin
        for (int i = 0; i < Globals.heroes.Count; i++)
        {
            string id = Globals.heroes[i].id;
            if (BattleGlobals.selectHeroes.Contains(id))
            {
                Hero       h       = Globals.heroes[i];
                GameObject winHero = Instantiate((GameObject)GameFuncs.GetResource("Prefabs/heroWin"));
                winHero.transform.SetParent(grid);
                winHero.GetComponent <Image>().sprite = Resources.Load <Sprite>("Character/Portrait/" + id);
                winHero.transform.Find("name").GetComponent <Text>().text = h.ename;
                Slider expSlider  = winHero.transform.Find("expSlider").GetComponent <Slider>();
                Text   lvText     = winHero.transform.Find("lvImage/lvText").GetComponent <Text>();
                Slider loveSlider = winHero.transform.Find("loveSlider").GetComponent <Slider>();
                //exp
                h.exps[1] += 10;
                if (h.exps[1] >= h.exps[2])//lv up
                {
                    h.exps[0]++;
                    for (int j = 0; j < h.infos.Length; j++)
                    {
                        h.infos[j] += (h.exps[0] - 1) * 10;
                    }
                    h.exps[1] -= h.exps[2];
                    h.exps[2] += (h.exps[0] - 1) * 100;
                    //add skill
                    foreach (Skill s in Globals.skillList)
                    {
                        if (!s.isCp && s.ele == h.ele && s.lv <= h.exps[0])//学会
                        {
                            h.skills.Add(s);
                            h.skills.Sort();
                        }
                    }
                }
                expSlider.value = (float)h.exps[1] / h.exps[2];
                lvText.text     = h.exps[0].ToString();
                //love
                h.li.love++;
                if (h.li.love >= h.li.maxLove)
                {
                    h.li.lv++;
                    h.li.love -= h.li.maxLove;
                }
                loveSlider.value = (float)h.li.love / h.li.maxLove;
                loveSlider.transform.Find("loveText").GetComponent <Text>().text =
                    h.li.love.ToString() + "/" + h.li.maxLove.ToString();
                loveSlider.transform.Find("Icon/lvText").GetComponent <Text>().text = h.li.lv.ToString();
            }
        }
        BattleGlobals.selectHeroes.Clear();
    }
Пример #8
0
    IEnumerator Wait(int time)
    {
        yield return(new WaitForSeconds(time));

        GameFuncs.GoToSceneAsync("Battle");
    }
Пример #9
0
 void OnsummonBtnClick()
 {
     MusicManager.PlaySe("click");
     GameFuncs.GoToSceneAsync("Summon");
 }
Пример #10
0
 void OnroomBtnClick()
 {
     MusicManager.PlaySe("click");
     GameFuncs.GoToSceneAsync("Room");
 }
Пример #11
0
 void OnheroesBtnClick()
 {
     MusicManager.PlaySe("click");
     GameFuncs.GoToSceneAsync("Heroes");
 }
Пример #12
0
 void OnbattleBtnClick()
 {
     MusicManager.PlaySe("click");
     GameFuncs.GoToSceneAsync("SelectBattleMap");
 }
Пример #13
0
 void OnbackBtnClick()
 {
     GameFuncs.GoToSceneAsync("Main");
 }