Thrust.Update C# (CSharp) Method

Update() private method

private Update ( ) : void
return void
	void Update () {

		trans = playerHead.GetComponent<Transform>();
        //lookVector = trans.eulerAngles;

		if (Cardboard.SDK.Triggered)
        {
            if (!thrustOn)
            {
                thrustOn = true;

            }
            else {
                thrustOn = false;
            }
        }

        if (thrustOn)
        {
            //forceVector = Vector3.Scale(trans.forward, lookVector);

			//add an instant velocity change along the current look direction
			//will be affected by drag of object this script is attached to
			rb.AddForce(trans.forward * speed, ForceMode.VelocityChange);
        }

    }

Usage Example

Esempio n. 1
0
        // necessary wrapper for main CalcRotate, should always be called.
        private void CalcRotate(Matrix localMatrix, RelativeDirection3F Direction, RelativeDirection3F UpDirect = null, bool gravityAdjusted = false, IMyEntity targetEntity = null)
        {
            //Log.DebugLog("entered CalcRotate(Matrix localMatrix, RelativeDirection3F Direction, RelativeDirection3F UpDirect = null, bool levelingOff = false, IMyEntity targetEntity = null)", "CalcRotate()");

            CheckGrid();
            Thrust.Update();

            if (!gravityAdjusted && ThrustersOverWorked())
            {
                CalcRotate_InGravity(Direction);
                return;
            }

            in_CalcRotate(localMatrix, Direction, UpDirect, targetEntity);
        }
All Usage Examples Of Thrust::Update