|
|
@@ -71,30 +71,37 @@ public class HomeView_ChallengeOption : MonoBehaviour
|
|
|
|
|
|
if (levelInfos[index].startGameType != -1 && selected)
|
|
|
{
|
|
|
- StartGame(levelInfos[index].startGameType);
|
|
|
+ JudgmentMode(levelInfos[index].startGameType);
|
|
|
}
|
|
|
//Debug.Log(str);
|
|
|
}
|
|
|
- public void StartGame(int gameType)
|
|
|
- {
|
|
|
- AudioMgr.ins.PlayBtn();
|
|
|
- if (GlobalDataTemp.pkMatchType == PKMatchType.OnlinePK)
|
|
|
+ /*
|
|
|
+ 只有奥运射箭,打野鸡,打野兔,打野狼这四个最初的游戏,才有这三个模式选择;还有三个新的游戏,只有一个本地游戏的模式,那就不用选择,直接进入游戏
|
|
|
+ */
|
|
|
+ void JudgmentMode(int _startGameType) {
|
|
|
+ //_startGameType 这里gameType仅仅用于判断模式
|
|
|
+ switch (_startGameType)
|
|
|
{
|
|
|
- int newGameType = 0;
|
|
|
- if (gameType == 3) newGameType = 10;
|
|
|
- else if (gameType == 4) newGameType = 11;
|
|
|
- else if (gameType == 5) newGameType = 12;
|
|
|
- GlobalDataTemp.matchGameType = newGameType;
|
|
|
- ViewMgr.Instance.ShowView<PKMatchView>();
|
|
|
- return;
|
|
|
+ case 1: //奥运射箭
|
|
|
+ case 3: //打野兔
|
|
|
+ case 4: //打野鸡
|
|
|
+ case 5: //打野狼
|
|
|
+ GameMgr.judgmentGameType = _startGameType;
|
|
|
+ AudioMgr.ins.PlayBtn();
|
|
|
+ //进入模式选择页面
|
|
|
+ ViewMgr.Instance.ShowView<ModeSelectView>();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ StartGame(_startGameType);
|
|
|
+ break;
|
|
|
}
|
|
|
- if (GlobalDataTemp.pkMatchType == PKMatchType.LocalPK)
|
|
|
- {
|
|
|
- if (gameType == 3) gameType = 6;
|
|
|
- else if (gameType == 4) gameType = 7;
|
|
|
- else if (gameType == 5) gameType = 8;
|
|
|
- }
|
|
|
- GlobalData.pkMatchType = GlobalDataTemp.pkMatchType;
|
|
|
+
|
|
|
+ }
|
|
|
+ //只有一个本地游戏的模式,没有其他模式
|
|
|
+ void StartGame(int gameType)
|
|
|
+ {
|
|
|
+ //Debug.Log("gameType:"+ gameType+ ",GlobalDataTemp.pkMatchType:"+ GlobalDataTemp.pkMatchType);
|
|
|
+ AudioMgr.ins.PlayBtn();
|
|
|
GameMgr.gameType = gameType;
|
|
|
if (gameType == 15)
|
|
|
{
|
|
|
@@ -108,10 +115,6 @@ public class HomeView_ChallengeOption : MonoBehaviour
|
|
|
{
|
|
|
SceneManager.LoadScene("DuckHunter", LoadSceneMode.Single);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
- SceneManager.LoadScene("GameChallenge", LoadSceneMode.Single);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
public void back()
|