當前位置: 首頁>>代碼示例>>C#>>正文


C# Rigidbody.Sleep方法代碼示例

本文整理匯總了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 ();
     }
 }
開發者ID:jmguillemette,項目名稱:LudumDare33,代碼行數:9,代碼來源:Punchable.cs

示例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>();
    }
開發者ID:navignaw,項目名稱:howlees,代碼行數:16,代碼來源:Sisyphus.cs

示例3: Start

 // Use this for initialization
 void Start()
 {
     rigidBody = this.gameObject.GetComponent<Rigidbody>();
     rigidBody.Sleep();
 }
開發者ID:xknight,項目名稱:madcatz,代碼行數:6,代碼來源:GrannyDoorScript.cs

示例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() ); }
    }
開發者ID:ekhudson,項目名稱:Train2013,代碼行數:20,代碼來源:BaseObject.cs

示例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);
    }
開發者ID:victorfisac,項目名稱:DriftWorld,代碼行數:42,代碼來源:CarSetup.cs

示例6: AoEHit

 // The AoE effect on game objects
 protected override void AoEHit(Rigidbody obj)
 {
     obj.velocity = Vector3.zero;
     obj.Sleep();
 }
開發者ID:judah4,項目名稱:battle-of-mages,代碼行數:6,代碼來源:AoEImmobilize.cs


注:本文中的UnityEngine.Rigidbody.Sleep方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。