Example #1
0
 /// <summary>
 /// Sets the currently displayed screen.
 /// </summary>
 /// <param name="screen">The screen to go to.</param>
 public void SetScreen(Screen.Screen screen)
 {
     this.screen = screen;
 }
Example #2
0
        public void Play(float time, int loopsCount, AnimationType animType, Ease easeType, Screen.Screen panelToHide)
        {
            var color = _image.color;

            //Screen.Screen.HideOrShowScreen(0.2f, panelToHide);
            _image.gameObject.SetActive(true);
            DOTween.To(() => _image.color, x => _image.color = x
                       , new Color(color.r, color.g, color.b, 1), 0.5f);
            Debug.Log(animType.ToString());
            switch (animType)
            {
            case AnimationType.Scaling:
                DOTween.To(() => (Vector2)_image.transform.localScale
                           , x => _image.transform.localScale = x
                           , new Vector2(1f, 1f), time).SetEase(easeType)
                .SetLoops(loopsCount, LoopType.Yoyo);
                break;

            case AnimationType.Rotating:
                DOTween.To(() => _image.transform.rotation
                           , x => _image.transform.rotation = x
                           , new Vector3(0, 0, -180), time).SetEase(easeType)
                .SetLoops(loopsCount, LoopType.Incremental);
                break;

            case AnimationType.ScalingAndRotating:
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(animType), animType, null);
            }
        }