Demo entry 6742302

Move

   

Submitted by lck on May 17, 2018 at 14:39
Language: C#. Code size: 666 Bytes.

void Update()
	{
		ComputerCtrl ();
		NodeCtrl ();
		PlayerCtrl ();
		// 遍历车轴
		foreach(AxleInfo axleInfo in axleinfos)
		{
			// 转向
			if(axleInfo.steering)
			{
				axleInfo.leftWheel.steerAngle = steering;
				axleInfo.rightWheel.steerAngle = steering;
			}
			// 马力,加一个限制加档位的
			if(axleInfo.motor)
			{
				axleInfo.leftWheel.motorTorque = motor;
				axleInfo.rightWheel.motorTorque = motor;
			}
			if(true)
			{
				axleInfo.leftWheel.brakeTorque = brakeTorque;
				axleInfo.rightWheel.brakeTorque = brakeTorque;
			}
			// 旋转
			if(axleinfos[1] != null)
			{
				WheelRotation (axleinfos[1].leftWheel);
			}
		}
		motorSound ();

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).