コード例 #1
0
    private void ChangeOrientation(UserInterfaceAlbumShipViewer.Orientation changeToOrientation, Action onFinished)
    {
        this.mDisplayOrientation = changeToOrientation;
        Sequence sequence = TweenSettingsExtensions.SetId <Sequence>(DOTween.Sequence(), UserInterfaceAlbumShipViewer.AnimationType.RotateDisplay);
        Tween    tween    = null;

        if (changeToOrientation != UserInterfaceAlbumShipViewer.Orientation.Vertical)
        {
            if (changeToOrientation == UserInterfaceAlbumShipViewer.Orientation.Horizontal)
            {
                Screen.set_orientation(3);
                Tween tween2 = ShortcutExtensions.DOLocalMove(this.mCamera_Main.get_transform(), Vector3.get_zero(), 0.3f, false);
                Tween tween3 = DOVirtual.Float(this.mCamera_Main.get_orthographicSize(), 1f, 0.9f, delegate(float size)
                {
                    this.mCamera_Main.set_orthographicSize(size);
                });
                Tween tween4 = TweenSettingsExtensions.OnComplete <Tweener>(ShortcutExtensions.DORotate(this.mCamera_Main.get_transform(), new Vector3(0f, 0f, 0f), 0.9f, 0), delegate
                {
                    this.mCamera_Main.get_transform().set_rotation(Quaternion.Euler(0f, 0f, 0f));
                });
                TweenSettingsExtensions.Append(sequence, tween4);
                TweenSettingsExtensions.Join(sequence, tween);
                TweenSettingsExtensions.Join(sequence, tween2);
                TweenSettingsExtensions.Join(sequence, tween3);
            }
        }
        else
        {
            Screen.set_orientation(1);
            Tween tween2 = ShortcutExtensions.DOLocalMove(this.mCamera_Main.get_transform(), Vector3.get_zero(), 0.3f, false);
            Tween tween3 = DOVirtual.Float(this.mCamera_Main.get_orthographicSize(), (float)this.DISPLAY_HEIGHT / (float)this.DISPLAY_WIDTH, 0.9f, delegate(float size)
            {
                this.mCamera_Main.set_orthographicSize(size);
            });
            Tween tween4 = TweenSettingsExtensions.OnComplete <Tweener>(ShortcutExtensions.DORotate(this.mCamera_Main.get_transform(), new Vector3(0f, 0f, 90f), 0.9f, 0), delegate
            {
                this.mCamera_Main.get_transform().set_rotation(Quaternion.Euler(0f, 0f, 90f));
            });
            TweenSettingsExtensions.Append(sequence, tween3);
            TweenSettingsExtensions.Join(sequence, tween);
            TweenSettingsExtensions.Join(sequence, tween2);
            TweenSettingsExtensions.Join(sequence, tween4);
        }
        TweenSettingsExtensions.OnComplete <Sequence>(sequence, delegate
        {
            if (onFinished != null)
            {
                onFinished.Invoke();
            }
        });
    }
コード例 #2
0
    // Use this for initialization
    void Start()
    {
        if (move == true)
        {
            ShortcutExtensions46.DOAnchorPosX(left, 0, moveTime).SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
            ShortcutExtensions46.DOAnchorPosX(right, 0, moveTime).SetEase(Ease.Linear).SetLoops(-1, LoopType.Yoyo);
        }

        if (rotate == true)
        {
            Vector3 startRotation;

            if (leftBody1)
            {
                startRotation    = leftBody1.rotation.eulerAngles;
                startRotation.z += 360f;
                ShortcutExtensions.DORotate(leftBody1, startRotation, rotateTime, RotateMode.FastBeyond360).SetEase(Ease.Linear).SetLoops(-1);
            }
            if (leftBody2)
            {
                startRotation    = leftBody2.rotation.eulerAngles;
                startRotation.z -= 360f;
                ShortcutExtensions.DORotate(leftBody2, startRotation, rotateTime, RotateMode.FastBeyond360).SetEase(Ease.Linear).SetLoops(-1);
            }

            if (rightBody1)
            {
                startRotation    = rightBody1.rotation.eulerAngles;
                startRotation.z += 360f;
                ShortcutExtensions.DORotate(rightBody1, startRotation, rotateTime, RotateMode.FastBeyond360).SetEase(Ease.Linear).SetLoops(-1);
            }
            if (rightBody2)
            {
                startRotation    = rightBody2.rotation.eulerAngles;
                startRotation.z -= 360f;
                ShortcutExtensions.DORotate(rightBody2, startRotation, rotateTime, RotateMode.FastBeyond360).SetEase(Ease.Linear).SetLoops(-1);
            }
        }
    }
コード例 #3
0
 private void Update()
 {
     if (this.seq == null)
     {
         this.delaytime -= Time.deltaTime;
         if (this.delaytime <= 0f)
         {
             this.seq = DOTween.Sequence();
             float num = 1f;
             TweenSettingsExtensions.Append(this.seq, TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DOScale(base.transform, 1f, num), 1));
             TweenSettingsExtensions.Join(this.seq, TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DORotate(base.transform, new Vector3(0f, 0f, 180f), num, 0), 1));
             TweenSettingsExtensions.Append(this.seq, TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DOScale(base.transform, 0f, num), 1));
             TweenSettingsExtensions.Join(this.seq, TweenSettingsExtensions.SetEase <Tweener>(ShortcutExtensions.DORotate(base.transform, new Vector3(0f, 0f, 360f), num, 0), 1));
             TweenSettingsExtensions.AppendInterval(this.seq, 0.33f);
             TweenSettingsExtensions.SetLoops <Sequence>(this.seq, -1);
         }
     }
 }
コード例 #4
0
 public static TweenerCore <Quaternion, Vector3, QuaternionOptions> DORotate(this Transform target,
                                                                             Vector3 endValue, float duration)
 {
     return(ShortcutExtensions.DORotate(target, endValue, duration));
 }