// Update is called once per frame void Update() { if (controller.motorStatus()) { float value = leverRoatation.ReadAxis(); float strength = magnet.GetComponent <SpringJoint>().spring; if ((strength < 100f && value > 0) || (strength > 10f && value < 0)) { //Debug.Log("Pulley"); strength = strength + 2f * value; magnet.GetComponent <SpringJoint>().spring = strength; } } }
// Update is called once per frame void Update() { if (controller.motorStatus()) { float value = leverRoatation.ReadAxis(); if (value > 0) { moveArm.ExtendArm(); } else if (value < 0) { moveArm.RetractArm(); } } }
// Update is called once per frame void Update() { if (controller.motorStatus()) { float value = leverRoatation.ReadAxis(); if (value > 0) { moveCab.MoveRight(); } else if (value < 0) { moveCab.MoveLeft(); } else if (Mathf.Approximately(value, 0)) { moveCab.StopRotate(); } } }
// Update is called once per frame void Update() { if (controller.motorStatus()) { float value = leverRotation.ReadAxis(); if (value > 0) { moveBoom.MoveUp(); } else if (value < 0) { moveBoom.MoveDown(); } else if (Mathf.Approximately(value, 0)) { moveBoom.armStop(); } } }