| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- /* 游戏模式-祖先类 */
- public abstract class GameMode
- {
- public GameMgr gameMgr;
- public bool pauseTimeCounting {
- get {
- return timeCountingPauseLockers.Count > 0;
- }
- }
- HashSet<System.Object> timeCountingPauseLockers = new HashSet<System.Object>();
- public void PauseTimeCounting(System.Object o)
- {
- timeCountingPauseLockers.Add(o);
- }
- public void ResumeTimeCounting(System.Object o)
- {
- timeCountingPauseLockers.Remove(o);
- }
- public GameMode(GameMgr gameMgr) {
- this.gameMgr = gameMgr;
- }
- public virtual void HitTarget(float score) {}
- public virtual bool DoNextShoot() { return true; }
- public virtual object[] Settle() {return null; }
- public virtual void Start() {}
- public virtual void Update() {} //fixedUpdate
- public virtual void FrameUpdate() {}
- public virtual void onBowReady() {}
- public virtual void onBowShoot() {}
- public void BanBowReady() {
- PauseTimeCounting(this);
- ArmBow armBow = GameObject.FindObjectOfType<ArmBow>();
- armBow.banReady = true;
- armBow.banShoot = true;
- }
- public void UnbanBowReady() {
- ResumeTimeCounting(this);
- ArmBow armBow = GameObject.FindObjectOfType<ArmBow>();
- armBow.banReady = false;
- armBow.banShoot = false;
- armBow.readyShoot();
- }
- }
|