本文整理汇总了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();
}