Example #1
0
    private IEnumerator MoveTo(EEcran NextScreen, bool ToLeft)
    {
        ConfigEcran Config        = GetConfig(Current);
        Vector3     StartPosition = Camera.transform.position;

        if (Config.ToLeftZ != Config.ToRightZ)
        {
            StartPosition.z = (ToLeft ? Config.ToRightZ : Config.ToLeftZ);
        }

        Config = GetConfig(NextScreen);
        Vector3 EndPosition = StartPosition;

        EndPosition.z = (ToLeft ? Config.ToLeftZ : Config.ToRightZ);

        float StartTime = Time.time;

        while (Time.time < StartTime + DureeTransition)
        {
            float Progress = (Time.time - StartTime) / DureeTransition;
            Camera.transform.position = Vector3.Lerp(StartPosition, EndPosition, Progress);

            yield return(null);
        }

        FinishTransitionTo(NextScreen, ToLeft);
    }
Example #2
0
    private void FinishTransitionTo(EEcran NextScreen, bool ToLeft)
    {
        Current = NextScreen;
        ConfigEcran Config = GetConfig(Current);

        Vector3 EndPosition = Camera.transform.position;

        EndPosition.z             = (ToLeft ? Config.ToLeftZ : Config.ToRightZ);
        Camera.transform.position = EndPosition;

        if (Footer != null)
        {
            if (Config.ShowFooter)
            {
                Footer.SetActive(true);
            }
        }

        if (Config.ShowHeader)
        {
            Header.SetActive(true);
        }

        if (Config.UIScreen != null)
        {
            Config.UIScreen.SetActive(true);
        }

        MoveInProgress = false;
    }
Example #3
0
    private void StartTransitionTo(EEcran NextScreen, bool ToLeft)
    {
        if (MoveInProgress == true)
        {
            return;
        }

        MoveInProgress = true;
        ConfigEcran Config = GetConfig(NextScreen);

        CloseAllPopups();

        if (Footer != null)
        {
            if (!Config.ShowFooter)
            {
                Footer.SetActive(false);
            }
        }

        if (!Config.ShowHeader)
        {
            Header.SetActive(false);
        }

        Config = GetConfig(Current);
        if (Config.UIScreen != null)
        {
            Config.UIScreen.SetActive(false);
        }

        StartCoroutine(MoveTo(NextScreen, ToLeft));
    }
Example #4
0
 public ConfigEcran GetConfig(EEcran Ecran)
 {
     return(Config.Find(T => T.Type == Ecran));
 }