MovePosition
获取该obj的this.transform, this.GetCompoent<Rigidbody>();
5.平台移动MovePositon();方法
private Transform m_Plate;
private Rigidbody m_plate;
private int direction=1;
public float speed=1;
void Start(){
m_Plate=this.transform;
m_plate=GetComponent<Rigidbody>();
}
void Update(){
if(m_Plate.position.x>=5&&direction>0){
direction=-1;
else if(m_Plate.position.x<=-6&&directon<0){
direction=1;
}
void FixedUpdate(){
m_Plate.MovePositon(vector3.x*speed*direction*Time.Fixeddatetime);