| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class YejiHuntGameMode_LocalPK : YejiHuntGameMode
- {
- int currentPlayerIndex = 0; // 双人0和1
- public YejiHuntGameMode_LocalPK(GameMgr gameMgr) : base(gameMgr) {
-
- }
- public override void Start()
- {
- Yeji.InitPreHeights();
- SetLevel(5);
- AddHuntGameView();
- AddReadyView();
- }
-
- public override bool DoNextShoot() {
- bool canDo = base.DoNextShoot();
- if (canDo) {
- NextPlayer();
- BanBowReady();
- AddReadyView();
- }
- return canDo;
- }
- void AddReadyView()
- {
- GameObject view = Resources.Load<GameObject>("Prefabs/Views/PKGameReadyView_Challenge");
- GameObject o = GameObject.Instantiate(view);
- PKGameReadyView_Challenge script = o.GetComponent<PKGameReadyView_Challenge>();
- script.currentPlayerIndex = currentPlayerIndex;
- }
- void NextPlayer() {
- currentPlayerIndex++;
- currentPlayerIndex %= 2;
- }
- }
|