Пример #1
0
 public void NextButton()
 {
     if (selectedCharId.Count == 0)
     {
         MainManager.Instance.WindowMessage("请选择至少一个角色!");
         return;
     }
     if (type == 1)
     {
         //MainManager.Instance.WindowMessage("战斗系统还没做好!");
         CancalButton();
         JJCManager.Instance.ReadyAttack(selectedCharId);
     }
     else if (type == 2)
     {
         chooseBack_A.SetActive(false);
         settingBack.SetActive(true);
         playerData  = new AddedPlayerData();
         isinstating = true;
         foreach (int unitid in selectedCharId)
         {
             playerData.playrCharacters.Add(new UnitData(unitid));
         }
         for (int i = 0; i < 5; i++)
         {
             charToggles_setting[i].interactable = i < selectedCharId.Count;
             //charToggles_setting[i].isOn = i == 0;
         }
         ReflashSettingPage();
         ReflashSettingValues();
     }
 }
Пример #2
0
 /// <summary>
 /// 调用选人面板的函数
 /// </summary>
 /// <param name="type">1-JJC开战选人,2-JJC编辑敌方队伍选人</param>
 /// <param name="playerData">敌人队伍,为空则不显示</param>
 public void CallChooseBack(int type, AddedPlayerData player = null)
 {
     this.type = type;
     baseBack.SetActive(true);
     chooseBack_A.SetActive(true);
     settingBack.SetActive(false);
     if (player == null)
     {
         enemyGroups.SetActive(false);
     }
     else
     {
         enemyGroups.SetActive(true);
         enemyTotalPointText.text = player.totalpoint + "";
         for (int i = 0; i < 5; i++)
         {
             if (player.playrCharacters.Count > i)
             {
                 enemyChars[i].SetButton(player.playrCharacters[i]);
             }
             else
             {
                 enemyChars[i].SetButton(-1);
             }
         }
     }
     //selectedCharId.Clear();
     if (PlayerPrefs.HasKey("selectedCharId"))
     {
         string id = PlayerPrefs.GetString("selectedCharId");
         try
         {
             string[] ids = id.Split('-');
             selectedCharId.Clear();
             for (int i = 0; i < ids.Length; i++)
             {
                 selectedCharId.Add(int.Parse(ids[i]));
             }
         }
         catch
         {
             Debug.LogError("读取预设阵容失败!");
             selectedCharId.Clear();
         }
     }
     ReflashBasePage(0);
     switchToggles[0].isOn = true;
     ReflashSelectedButtons();
     if (type == 1)
     {
         nextButtonText.text = "战斗开始";
     }
     else if (type == 2)
     {
         nextButtonText.text = "下一步";
     }
 }
Пример #3
0
 public void SetButton(AddedPlayerData player, int pos)
 {
     this.pos            = pos;
     positionText.text   = pos + "";
     nameText.text       = player.playerName;
     levelText.text      = player.playerLevel + "";
     totalPointText.text = player.totalpoint + "";
     for (int i = 0; i < 5; i++)
     {
         if (player.playrCharacters.Count > i)
         {
             characters[i].SetButton(player.playrCharacters[i]);
         }
         else
         {
             characters[i].SetButton(-1);
         }
     }
 }
Пример #4
0
 /// <summary>
 /// 调用选人面板的函数
 /// </summary>
 /// <param name="type">1-JJC开战选人,2-JJC编辑敌方队伍选人</param>
 /// <param name="playerData">敌人队伍,为空则不显示</param>
 public void CallChooseBack(int type, AddedPlayerData player = null)
 {
     this.type = type;
     baseBack.SetActive(true);
     chooseBack_A.SetActive(true);
     settingBack.SetActive(false);
     if (player == null)
     {
         enemyGroups.SetActive(false);
     }
     else
     {
         enemyGroups.SetActive(true);
         enemyTotalPointText.text = player.totalpoint + "";
         for (int i = 0; i < 5; i++)
         {
             if (player.playrCharacters.Count > i)
             {
                 enemyChars[i].SetButton(player.playrCharacters[i]);
             }
             else
             {
                 enemyChars[i].SetButton(-1);
             }
         }
     }
     //selectedCharId.Clear();
     ReflashBasePage(0);
     switchToggles[0].isOn = true;
     ReflashSelectedButtons();
     if (type == 1)
     {
         nextButtonText.text = "战斗开始";
     }
     else if (type == 2)
     {
         nextButtonText.text = "下一步";
     }
 }
Пример #5
0
 /// <summary>
 /// 编辑完敌方阵容后调用
 /// </summary>
 /// <param name="addedPlayerData"></param>
 public void FinishAddingNewPlayer(AddedPlayerData addedPlayerData)
 {
     players.Add(addedPlayerData);
     Reflash(false);
     SaveDataToJson();
 }