当前位置: 首页>>代码示例>>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;未经允许,请勿转载。