protected virtual void Update() { if (Input.GetKey(positiveKey)) { mechanism.DriveMechanism(1.0f); } else if (Input.GetKey(negativeKey)) { mechanism.DriveMechanism(-1.0f); } }
public void DriveMechanism(bool positive = true) { float dir = positive ? 1.0f : -1.0f; if (!mechanism || !driveCapability) { return; } mechanism.DriveMechanism(dir); }