void FixedUpdate() { activated = MyInputManager.InRange(transform.position, 2) != '0'; offset = mat.mainTextureOffset; if (activated && offset.y >= 0) { offset = Vector2.Lerp(offset, new Vector2(0, 0), speed); } if (!activated && offset.y <= 0.5f) { offset = Vector2.Lerp(offset, new Vector2(0, 0.5f), speed); } mat.mainTextureOffset = offset; }
void Update() { if (transform.localPosition.x > 3 || transform.localPosition.y > 3 || transform.localPosition.z > 3 || transform.localPosition.x < -3 || transform.localPosition.y < -3 || transform.localPosition.z < -3) { transform.localPosition = Vector3.up; } var position = new Vector3(transform.position.x - 7.829586f, transform.position.y - 0.9757428f, transform.position.z + 3.546846f); //var position = transform.parent.localPosition; target.localPosition = new Vector3(position.x * 3 * 1.7f, position.y * 1.7f, -position.z * 3 * 1.7f); target.localEulerAngles = new Vector3(transform.eulerAngles.x, transform.eulerAngles.y, transform.eulerAngles.z); handIndicator = MyInputManager.InRange(transform.position, 0.5f); if (handIndicator != '0') { if (!isGrabbed) { outline.enabled = true; } if (MyInputManager.GripValue(handIndicator) > 0 && !isGrabbed) { isGrabbed = true; outline.enabled = false; } if (MyInputManager.GripValue(handIndicator) > 0 && !isGrabbed) { isGrabbed = true; outline.enabled = false; } MoveClaws(MyInputManager.TriggerValue(handIndicator)); if (isGrabbed && MyInputManager.GripValue(handIndicator) <= 0) { isGrabbed = false; } } }
private void Update() { if (listenForRaycast) { handIndicator = MyInputManager.HoveredByRayInteractor(_collider); } if (listenForRaycast && handIndicator == '0') { handIndicator = MyInputManager.InRange(transform.position, grabbingRange); } if (!listenForRaycast) { handIndicator = MyInputManager.InRange(transform.position, grabbingRange); } if (handIndicator != '0') { Select(true); } else { Select(false); } }