using UnityEngine;
using System.Collections;
//开始时+一个限制 必须有刚
[RequireComponent (typeof(Rigidbody ))]
//碰撞器[RequireComponent(typeof (CapsuleCollider ))]
public class playerControll : MonoBehaviour {
[System.Serializable] //可视化
//将与速度有关的量提出到一个方法 里
public class MoveSetting{
public float ForwardSpeed = 5f;
public float BackSpeed = 3f;
public float HorizonSpeed = 4f;public float RunValue = 2f;
public float JumpForce = 5f;}
[System.Serializable ]
public class MouseLook{
//摄像机旋转灵敏度
public float XSensitive = 2f;
public float YSensitive = 2f;}
public MoveSetting moveSet;
public MouseLook CameraSet;public float currentSpeed;
//设定一个bool值来判断是否可以跳跃
private bool m_jump = true;private CapsuleCollider m_capsule;
private Rigidbody m_rigidbody;private Camera m_camera;
//相机的Transform减少Update中transform的调用
private Transform m_camTrans;
//主角的Transform
private Transform m_chaTrans;//摄像机的欧拉角
private Vector3 m_camRotate;
//主角的欧拉角
private Vector3 m_chaRotate;
//摄像机旋转四元数private Quaternion m_camQutation;
//主角的旋转四元数private Quaternion m_chaQutation;
public AnimationCurve SlopCurve;private bool m_isOnG