本文整理匯總了C#中UnityEngine.Rigidbody.Sleep方法的典型用法代碼示例。如果您正苦於以下問題:C# Rigidbody.Sleep方法的具體用法?C# Rigidbody.Sleep怎麽用?C# Rigidbody.Sleep使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEngine.Rigidbody
的用法示例。
在下文中一共展示了Rigidbody.Sleep方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Start
// Use this for initialization
void Start()
{
body = GetComponent<Rigidbody> ();
agent = GetComponent<NavMeshAgent> ();
if (body != null) {
body.Sleep ();
}
}
示例2: Awake
private int moving = 0; // -1 for left, 1 for right
void Awake () {
rb = GetComponent<Rigidbody>();
rb.Sleep();
boulder.Sleep();
startPos = transform.position;
startRot = transform.rotation;
startTransPos = objectTransform.position;
boulderStartPos = boulder.transform.position;
groundStartPos = ground.position;
prevGroundPos = ground.position;
anim = transform.GetComponentInParent<Animator>();
}
示例3: Start
// Use this for initialization
void Start()
{
rigidBody = this.gameObject.GetComponent<Rigidbody>();
rigidBody.Sleep();
}
示例4: Awake
protected virtual void Awake()
{
//grab component references
_transform = transform;
_gameObject = gameObject;
_renderer = renderer;
_collider = collider;
_rigidbody = rigidbody;
_instanceID = gameObject.GetInstanceID();
//calculate the update interval (assuming ideal target of 60 fps)
_updateInterval = UpdatesPerSecond / 60f;
//check conditions
if (_rigidbody != null && !RigidBodyAwakeOnStart) { _rigidbody.Sleep(); }
if (!GameObjectActiveOnStart) { _gameObject.active = false; }
//start coroutines
if (_renderer != null) { StartCoroutine( CheckIsHidden() ); }
}
示例5: Awake
private void Awake()
{
auxRigidbody = transform.GetComponent<Rigidbody>();
if (RigidbodySleepOnAwake)
{
auxRigidbody.Sleep();
}
// Initialize values
NitroLeft = NitroInitialAmount;
if (CenterOfMass != null)
{
GetComponent<Rigidbody>().centerOfMass = CenterOfMass.localPosition;
}
if (WheelBase != null)
{
WheelBase.localPosition = new Vector3(0, WheelBaseAlignment);
}
if (SkidmarkObjectName != "")
{
if (GameObject.Find(SkidmarkObjectName))
{
SkidMarks = GameObject.Find(SkidmarkObjectName);
Debug.Log(SkidMarks.name);
}
}
if (CarInteria < 0.01f)
{
CarInteria = 0.01f;
}
GetComponent<Rigidbody>().inertiaTensor *= CarInteria;
updateVehicleConfig();
NosFireObject.SetActive(false);
}
示例6: AoEHit
// The AoE effect on game objects
protected override void AoEHit(Rigidbody obj)
{
obj.velocity = Vector3.zero;
obj.Sleep();
}