ControllerColliderHit.moveLength 移动长度
var moveLength : float
Description描述
How far the character has travelled until it hit the collider.
直到它碰到碰撞器之前角色移动了多少距离。
Note that this can is different from what you pass to CharacterController.Move, because all movement is constrained by collisions.
注意这可能从你传递到CharacterController.Move是不同的。因为的所有的意思被碰撞约束。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void OnControllerColliderHit(ControllerColliderHit hit) {
Debug.Log(hit.moveLength);
}
}
unction OnControllerColliderHit(hit : ControllerColliderHit) {
ebug.Log(hit.moveLength);
}
最后修改:2010年12月23日 Thursday 20:08