Ejemplo n.º 1
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);
    }
Ejemplo n.º 2
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);
     }
 }