示例#1
0
    IEnumerator TestFade()
    {
        yield return(new WaitForSecondsRealtime(1));

        CameraEffects.StartFadeToBlack(() => { print("start finished"); });
        yield return(new WaitForSecondsRealtime(3));

        CameraEffects.StartFadeToGame(() => { print("end finished"); });
    }
示例#2
0
 public void GoToEndScreen()
 {
     CameraEffects.StartFadeToBlack(() =>
     {
         DOTween.KillAll(false);
         Reset();
         StoryState.Instance.Reset();
         UnityEngine.SceneManagement.SceneManager.LoadScene(2);
     });
 }
示例#3
0
    // Start is called before the first frame update
    void Start()
    {
        button = GetComponent <Button>();
        Image image = GetComponent <Image>();
        var   text  = GetComponentInChildren <TextMeshProUGUI>();

        button.onClick.AddListener(() =>
        {
            var imagetargetColor = image.color;
            imagetargetColor.a   = 0;

            button.interactable = false;
            text.DOFade(0, 0.18f).SetEase(Ease.Linear);
            image.DOFade(0, 0.18f).SetEase(Ease.Linear); //(imagetargetColor, 0.15f).SetEase(Ease.OutFlash).Play();
            background.DOFade(0, 0.18f).SetEase(Ease.Linear);

            CameraEffects.StartFadeToBlack(() =>
            {
                Gamemode.LoadSceneBlocking(rooms.Game);
            }, DG.Tweening.Ease.InQuart, 1.2f
                                           );
        });
    }