private IEnumerator TrackModule() { NeedyComponent needyModule = module.BombComponent.GetComponent <NeedyComponent>(); NeedyStateEnum lastState = needyModule.State; while (true) { switch (needyModule.State) { case NeedyStateEnum.BombComplete: case NeedyStateEnum.Terminated: yield break; case NeedyStateEnum.Cooldown when lastState == NeedyStateEnum.Running: if (module.Claimed) { var player = module.PlayerName; if (!Scores.ContainsKey(player)) { Scores[player] = 0; } Scores[player] += Points; } module.Solver.AwardRewardBonus(); break; } lastState = needyModule.State; yield return(new WaitForSeconds(0.1f)); } }
public ClaimTime(float points, TwitchModule module) : base(points) { this.module = module; module.StartCoroutine(TrackModule()); needyComponent = module.BombComponent.GetComponent <NeedyComponent>(); }
public override void Start() { base.Start(); this.KMAudio = this.GetComponent <KMAudio>(); #if (!DEBUG) this.needyComponent = this.GetComponent <NeedyComponent>(); this.toneGenerator = this.gameObject.AddComponent <ToneGenerator>(); this.baseGain = this.toneGenerator.gain; #endif }