| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class RabbitHuntGameMode_LocalPK : RabbitHuntGameMode
- {
- int currentPlayerIndex = 0; // 双人0和1
- public RabbitHuntGameMode_LocalPK(GameMgr gameMgr) : base(gameMgr) {
-
- }
- public override void Start()
- {
- 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;
- }
- }
|