| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class RabbitHuntGameMode_LocalPK : RabbitHuntGameMode, ChallengeGameModeLocalPK
- {
- int currentPlayerIndex = 0; // 双人0和1
- public RabbitHuntGameMode_LocalPK(GameMgr gameMgr) : base(gameMgr) {
-
- }
- public override void Start()
- {
- SetLevel(5);
- AddHuntGameView();
- this.gameMgr.transform.Find("HunterGameView_LocalPK").gameObject.SetActive(true);
- 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;
- }
- //localPK interface
- public int GetCurrentPlayIndex() {
- return currentPlayerIndex;
- }
- }
- public interface ChallengeGameModeLocalPK {
- public int GetCurrentPlayIndex();
- }
|