Exemplo n.º 1
0
    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");
 }
Exemplo n.º 3
0
 /// <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();
 }
Exemplo n.º 4
0
 protected virtual void OnRotationChanged(RotationChangedEventArgs e)
 {
     rotationChanged?.Invoke(this, e);
 }