public void Update() { if (flag.CheckBit(TimerState.Exception)) { flag.FoldBit(TimerState.Finish); } if (!flag.CheckBit(TimerState.Start)) { return; } if (flag.CheckBit(TimerState.Pause)) { return; } //1フレームにかかった時間を加算 CountSeconds += Time.deltaTime; if (CountSeconds >= 1.0f) { CountSeconds = 0.0f; //カウントダウン処理 if (--seconds < 0) { seconds = minute > 0 ? 59 : 0; minute = Mathf.Max(minute - 1, 0); } //タイマー終了 if (minute == 0 && seconds == 0) { flag.FoldBit(TimerState.Start); flag.AddBit(TimerState.Finish); } if (!flag.CheckBit(TimerState.Finish)) { return; } //タイマーをループさせる場合 if (flag.CheckBit(TimerState.Loop)) { seconds = initSeconds; minute = initMinute; flag.AddBit(TimerState.Start); } } }
public bool IsFull() { return(state.CheckBit(State.Full)); }
// Update is called once per frame void Update() { //入浴フラグ折る state.FoldBit(State.Intrusion); //TODO:客ごとに共通の適正温度にするなら var BestFirePowerMin = themoMan.GetBestFirePowerMin(); var BestFirePowerMax = themoMan.GetBestFirePowerMax(); //入浴中なら if (state.CheckBitOR(State.Bathing | State.FriedBathing)) { animator.SetBool("Grab", false); animator.SetBool("Walk", false); animator.enabled = false; friedTimer.Update(); reactionTimer.Update(); //満足度の増減 var nowFirePower = themoCtrl.GetFirePower(); if (nowFirePower >= BestFirePowerMin && nowFirePower <= BestFirePowerMax) { if (!state.CheckBit(State.Burn)) { satisfy.AddSatisfy(); reactionState = ReactionState.Good; } } else { satisfy.SubSatisfy(); reactionState = ReactionState.Shock; } //焦げたら満足度減少 if (state.CheckBit(State.Burn)) { satisfy.SubSatisfy(); } //揚げ時間を越したら焦げ状態 if (friedTimer.IsFinish()) { state.AddBit(State.Burn); reactionState = ReactionState.Bad; } if (reactionTimer.IsFinish()) { Reaction(); } //入浴中のお客さんが揚がるかどうか if (state.CheckBitOR(State.Bathing) && satisfy.SatisfyValue > FriedSatisfy) { state.FoldBit(State.Bathing); state.AddBit(State.FriedBathing); spriteRenderer.sprite = FriedBathingSprite; } } //表情 FacialExpression(); if (state.CheckBit(State.Drag)) { return; } //移動 Move(); //画面外で破棄 ScreenOut(); }