CharacterController.isGrounded 是否地面
var isGrounded : bool
Description描述
Was the CharacterController touching the ground during the last move?
在最后的移动角色控制器是否触碰地面?
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
void Update() {
CharacterController controller = GetComponent<CharacterController>();
if (controller.isGrounded)
print("We are grounded");
}
}
function Update () {
var controller : CharacterController = GetComponent(CharacterController);
if (controller.isGrounded)
print("We are grounded");
}
最后修改:2010年12月14日 Tuesday 13:31