private static void ControlHand( SpringJoint controlJoint, SmoothFloat controlWeight, Vector3 targetPosition, Rigidbody rigidbody, bool doControl, Vector3 direction, float force ) { controlJoint.transform.position = targetPosition; controlWeight.Put(doControl ? 1f : 0f); controlJoint.spring = Mathf.Lerp(0, force, controlWeight.Value); if (controlWeight.Value > freezeHandRotationThreshold) { rigidbody.MoveRotation(Quaternion.LookRotation(direction) * handCorrection); rigidbody.freezeRotation = true; } else { rigidbody.freezeRotation = false; } }
public SmoothVector(float time) { Time = time; x = new SmoothFloat(time); y = new SmoothFloat(time); z = new SmoothFloat(time); }
void Awake() { _smoothPercentage = 0.0f; _smoothPercentage.Duration = 0.0f; _stripCamera = gameObject.GetComponentInChildren <StripCamera>(); _input = InputController.instance; }
protected virtual void Awake() { activePlayer = null; smoothYaw = new SmoothFloat(); smoothPitch = new SmoothFloat(); smoothTransform = gameObject.EnsureComponent <SmoothTransform>(); syncedObject = gameObject.EnsureComponent <SyncedObject>(); }
public void Start() { _eyeOffset = new SmoothFloat(0); _eyeOffset.Ease = EasingType.Cubic; _eyeOffset.Mode = SmoothingMode.smooth; _eyeOffset.Duration = 2.0f; _eyeMaterialLeft = (GameObject.Find(Identifier + "_eye_Left")).renderer.material; _eyeMaterialRight = (GameObject.Find(Identifier + "_eye_Right")).renderer.material; _logic = Logic.instance; _.Wait(2.0f).Done(Blink); }
void Awake() { _volume = 0.0f; }
public SmoothVector(bool rt) { x = new SmoothFloat (rt); y = new SmoothFloat (rt); z = new SmoothFloat (rt); }