Пример #1
0
            // 毎フレーム呼ばれる関数
            public override void Proc()
            {
                // 無敵モード
                if (Parent.MutekiRequest() && Parent.input.GetButtonDown(TadaInput.ButtonCode.MouseRight))
                {
                    ChangeState((int)eState.Super);
                    return;
                }

                // 上方向に当たっていたら速度をゼロに
                if (Parent.trb.TopCollide)
                {
                    Parent.Velocity = new Vector2(Parent.Velocity.x, -0.05f);
                }

                // 自身の左右が壁に当たったら死亡
                if (Timer >= (mutekiTime * (50.0f / StageObjectManager.staticRotateSpeed)))
                {
                    if (Parent.trb.RightCollide || Parent.trb.LeftCollide)
                    {
                        ChangeState((int)eState.Dead);
                        return;
                    }
                }

                // 接地してたらwalkステートへ ただ、一定時間は無視する(ジャンプできなくなるので)
                if (Parent.trb.ButtomCollide && Timer >= ((50.0f / StageObjectManager.staticRotateSpeed) * 0.2f))
                {
                    ChangeState((int)eState.Walk);
                    return;
                }

                // ジャンプボタン+頂点付近ならアピール
                if (!doneAppeal)
                {
                    if (Mathf.Abs(Parent.Velocity.y) <= appealEnableSpeed && Parent.input.GetButtonDown(TadaInput.ButtonCode.MouseLeft, false))
                    {
                        Parent.AddAppealGauge(2);
                        appearlEff.gameObject.SetActive(true);
                        appearlEff.Play();
                        Parent.color.Flash(); // 本体を光らせる
                        Parent.audioSource.PlayOneShot(appealSE);
                        doneAppeal = true;
                    }

                    // アピールチャンスの円を書く
                    if (Parent.Velocity.y >= 0.0f)
                    {
                        //もしボタン押してアピールできる状態なら
                        if (Mathf.Abs(Parent.Velocity.y) <= appealEnableSpeed)
                        {
                            //circleの色を押せることをわかりやすくするために変える
                            circle.AppealColorChenge();
                        }
                        circle.Show(Mathf.Abs(Parent.Velocity.y));
                    }
                    else circle.Hide();
                }
                else circle.Hide();
            }