コード例 #1
0
 // Use this for initialization
 void Start()
 {
     body = GetComponent<Rigidbody> ();
     agent = GetComponent<NavMeshAgent> ();
     if (body != null) {
         body.Sleep ();
     }
 }
コード例 #2
0
 static public int Sleep(IntPtr l)
 {
     try {
         UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l);
         self.Sleep();
         return(0);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
コード例 #3
0
 static public int Sleep(IntPtr l)
 {
     try {
         UnityEngine.Rigidbody self = (UnityEngine.Rigidbody)checkSelf(l);
         self.Sleep();
         return(0);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
コード例 #4
0
ファイル: Sisyphus.cs プロジェクト: navignaw/howlees
    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>();
    }
コード例 #5
0
 static int Sleep(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.Rigidbody obj = (UnityEngine.Rigidbody)ToLua.CheckObject(L, 1, typeof(UnityEngine.Rigidbody));
         obj.Sleep();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #6
0
ファイル: GrannyDoorScript.cs プロジェクト: xknight/madcatz
 // Use this for initialization
 void Start()
 {
     rigidBody = this.gameObject.GetComponent<Rigidbody>();
     rigidBody.Sleep();
 }
コード例 #7
0
ファイル: BaseObject.cs プロジェクト: ekhudson/Train2013
    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() ); }
    }
コード例 #8
0
ファイル: CarSetup.cs プロジェクト: victorfisac/DriftWorld
	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);
    }
コード例 #9
0
 // The AoE effect on game objects
 protected override void AoEHit(Rigidbody obj)
 {
     obj.velocity = Vector3.zero;
     obj.Sleep();
 }