// Update is called once per frame void Update() { if (!photonView.isMine) { characterController.Move(new Vector3(0.0f, -0.01f, 0.0f)); //速度によって左右を向かせる if (receiveVelocity.x > 0.0f) { ChildObj.transform.rotation = Quaternion.Euler(0, 140, 0); } else if (receiveVelocity.x < 0.0f) { ChildObj.transform.rotation = Quaternion.Euler(0, -140, 0); } return; } particle.Stop(); transform.tag = "Untagged"; // ADD SideMoveState.StateUpdate(); JumpState.StateUpdate(); AliveState.StateUpdate(); AliveState.Execute(); }
//====================== 状態別処理 ============================= //ここにはキャラクターが各状態の場合のそれぞれの処理を書く void SurvivalExe() { //死亡したらAliveStateをm_IvyStateに変更する transform.tag = "Player"; // ADD //===移動ベクトルを求める処理=== SideMoveState.Execute(); JumpState.Execute(); //======================= Collision(); //ベクトルを元にして実際に移動させる IsToPress(); //地面に押し付ける処理 if (m_JumpVelocity != 0) { velocity.y = m_JumpVelocity; //ジャンプしてたらジャンプしてね! } characterController.Move((velocity * Time.deltaTime) + MoveFloorVec); //移動床のベクトルも足しこんでいる。移動床のベクトルはデルタタイム済み MoveFloorVec = Vector3.zero; //とりあえず移動床のベクトルは毎度ゼロに //速度によって左右を向かせる if (velocity.x > 0.0f) { ChildObj.transform.rotation = Quaternion.Euler(0, 140, 0); } else if (velocity.x < 0.0f) { ChildObj.transform.rotation = Quaternion.Euler(0, -140, 0); } if (transform.position.y < -20.0f) { soundManager.PlaySE("Rakka"); //サウンド 落下したときの音 SetDeathData(); } // ADD こいつらをUpdateから持ってきた //情報更新系 UpdateCapsule(); //当たり判定を取るためのカプセル情報の更新 HitObjectCheck(); //当たり判定を行う }