private void Starfighter_OnRotationChanged(object sender, RotationChangedEventArgs e) { Starfighter o = (Starfighter)sender; //float tiltAngle = -Mathf.Sign(o.TranslateVector.x) * Mathf.Lerp(0, o.cameraFollowSpeedFactor * 30, Mathf.Abs(o.TranslateVector.normalized.x)); float starfighterTiltAngle = MathUtils.ToSignedAngle(o.transform.rotation.eulerAngles.z); float tiltAngle = MathUtils.AbsMin(starfighterTiltAngle, maxTiltAngle); transform.rotation = Quaternion.AngleAxis(tiltAngle, Vector3.forward); }
/// <summary> /// Handles "RotationChanged" event. /// When the rotation for device is changed, this callback function will be called /// </summary> /// <param name="sender"> The sender object. </param> /// <param name="e"> Argument of Event. </param> private static void InputMethodEditor_RotationChanged(object sender, RotationChangedEventArgs e) { Log.Info("IMESample", "InputMethodEditor_RotationChanged callback"); }
/// <summary> /// Handles "RotationChanged" event /// When the rotation for device is changed, this callback function will be called /// </summary> /// <param name="sender"> The sender object. </param> /// <param name="e"> Argument of Event. </param> private static void InputMethodEditor_RotationChanged(object sender, RotationChangedEventArgs e) { Log.Info("IMESample", "InputMethodEditor_RotationChanged callback"); currentAngle = e.Degree; LoadLayout(); }
protected virtual void OnRotationChanged(RotationChangedEventArgs e) { rotationChanged?.Invoke(this, e); }