コード例 #1
0
    public void ZoomOut()
    {
        if (!IsZoomed || !IsZoomInPlace)
        {
            return;
        }

        IsZoomed      = false;
        IsZoomInPlace = false;

        GameController.Instance.Unpause();

        foreach (GameObject cardGameObject in cardGameObjects)
        {
            LerpInformation <Vector3> positionLerpInformation = new LerpInformation <Vector3>(
                cardGameObject.transform.position, positionsBeforeZoom[cardGameObject],
                ZoomLerpDuration, Vector3.Lerp);
            zoomMovementLerpInformations[cardGameObject] = positionLerpInformation;

            LerpInformation <Quaternion> rotationLerpInformation = new LerpInformation <Quaternion>(
                cardGameObject.transform.rotation, rotationsBeforeZoom[cardGameObject],
                ZoomLerpDuration, Quaternion.Lerp);
            zoomRotationLerpInformations[cardGameObject] = rotationLerpInformation;
        }

        zoomScaleLperInformation = new LerpInformation <Vector3>(transform.localScale, new Vector3(0.5f, 0.5f, 1),
                                                                 ZoomLerpDuration, Vector3.Lerp);

        ZoomedOut?.Invoke(this, new CardStackEventArgs(this));
    }
コード例 #2
0
 void ChangeButtonStatesAfterAnimationCompleted()
 {
     if (currentTransitionType == TransitionType.Forward || currentTransitionType == TransitionType.Backward || currentTransitionType == TransitionType.Inward)
     {
         DefaultState?.Invoke();
     }
     else if (currentTransitionType == TransitionType.Outward)
     {
         ZoomedOut?.Invoke();
     }
 }
コード例 #3
0
    void FinishTransitioning()
    {
        transitioning = false;
        focused       = !focused;
        lerpPct       = 0;

        if (focused)
        {
            ZoomedIn?.Invoke();
        }
        else
        {
            ZoomedOut?.Invoke();
        }
    }