示例#1
0
    // 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();
    }