Esempio n. 1
0
	private void Update() {
		if (!isLocalPlayer) return;

		var newControls = new Controls(
			GetAxis("Vertical"),
			GetAxis("Horizontal"),
			GetAxis("Mouse X"),
			GetAxis("Mouse Y"),
			GetButton("Jump"),
			GetButton("Crouch"),
			GetButton("Fire1")
		);

		HandleHolo();
		HandleHighlights();

		if (_vehicleCtrl) {
			_vehicleCtrl.SetControls(newControls);
			if (GetButtonDown("Cancel")) CmdExitVehicle();
		} else {
			SetControls(newControls);
			if (GetButtonDown("Spawn1")) _spawn.CmdSpawn(MediumTransport);
			if (GetButtonDown("Spawn2")) SetBuildMode(HmgTurret);
			if (GetButtonDown("Spawn3")) SetBuildMode(Factory1);
			if (GetButtonDown("Spawn4")) _spawn.CmdSpawn(Tank);
		}
	}