Beispiel #1
0
 static public void StartCinematic(float duration, CinematicPan panIn = null, CinematicPan panOut = null, CinematicCallback onComplete = null)
 {
     if (StartCinematic(panIn, panOut, onComplete))
     {
         _instance.CancelInvoke("StopCinematicInstance");
         _instance.Invoke("StopCinematicInstance", duration);
     }
 }
Beispiel #2
0
    private void OnDestroy()
    {
        if (_instance == this)
        {
            DestroyTopBar();
            DestroyBottomBar();

            _instance  = null;
            _topBar    = null;
            _bottomBar = null;
            _panIn     = null;
            _panOut    = null;

            ScreenResizeEvent.onScreenResize -= OnScreenResize;
        }
    }
Beispiel #3
0
    static public void StopCinematic()
    {
        if (Cinematic.instance != null)
        {
            if (_isCinematicActive)
            {
                _topBar.transform.DOMoveY(1.5f, barTweenDuration).
                SetEase(easeOut);

                _bottomBar.transform.DOMoveY(-1.5f, barTweenDuration).
                SetEase(easeOut).OnComplete(OnStopCinematicComplete);

                if (_panOut != null)
                {
                    _panOut.PanOut();
                    _panOut = null;
                }
            }
        }
    }
Beispiel #4
0
    static public bool StartCinematic(CinematicPan panIn = null, CinematicPan panOut = null, CinematicCallback onComplete = null)
    {
        bool started = false;

        if (Cinematic.instance != null)
        {
            if (!_isCinematicActive)
            {
                _isCinematicActive = true;

                _topBar.enabled            = true;
                _topBar.transform.position = new Vector3(0.0f, 1.5f, 0.0f);
                _topBar.transform.DOMoveY(1.5f - barSizePercent, barTweenDuration)
                .SetEase(easeIn);

                _bottomBar.enabled            = true;
                _bottomBar.transform.position = new Vector3(0.0f, -1.5f, 0.0f);
                _bottomBar.transform.DOMoveY(-1.5f + barSizePercent, barTweenDuration)
                .SetEase(easeIn);

                _panIn  = panIn;
                _panOut = panOut;

                if (_panIn != null)
                {
                    _panIn.PanIn();
                    _panIn = null;
                }

                _onComplete = onComplete;

                started = true;
                Debug.Log("Cinematic Started");
            }
        }

        return(started);
    }