public void StartRewardAnimation(ScreenFadeCallBack callback)
    {
        generalAnimator.enabled = true;
        completeCallback        = callback;

        basketController.Shake(basketController.shakeIntensity, 0.2f);
        basketController.StartGlow();
    }
Beispiel #2
0
    public void RealShake(Vector3 strength, float time, float delay = 0.0f, ScreenFadeCallBack callback = null)
    {
        shakeCallback = callback;

        iTween.ShakeRotation(gameObject, iTween.Hash(
                                 "amount", strength,
                                 "time", time,
                                 "delay", delay,
                                 "onComplete", "ShakeFinished",
                                 "onCompleteTarget", gameObject
                                 ));
    }
Beispiel #3
0
    public void Shake(Vector3 strength, float time, float delay = 0.0f, ScreenFadeCallBack callback = null)
    {
        shakeCallback = callback;

        iTween.RotateAdd(gameObject, iTween.Hash(
                             "amount", strength,
                             "time", time,
                             "delay", delay,
                             "looptype", iTween.LoopType.pingPong,
                             "onComplete", "ShakeFinished",
                             "onCompleteTarget", gameObject
                             ));
    }
Beispiel #4
0
    public void FadeIn(ScreenFadeCallBack callback = null)
    {
        fadeInCallback = callback;

        iTween.ValueTo(fadeScreen.gameObject, iTween.Hash(
                           "from", 1.0f,
                           "to", 0.0f,
                           "time", fadeInTime,
                           "easetype", "linear",
                           "onComplete", "FadeInFinished",
                           "onCompleteTarget", gameObject,
                           "onUpdate", "OnFade",
                           "onUpdateTarget", gameObject
                           ));
    }
Beispiel #5
0
    public void FadeOutBrokenGlass(ScreenFadeCallBack callback = null)
    {
        fadeOutCallback = callback;

        iTween.ValueTo(brokenGlass.gameObject, iTween.Hash(
                           "from", 1.0f,
                           "to", 0.0f,
                           "time", fadeOutTime,
                           "easetype", "linear",
                           "onComplete", "FadeOutFinished",
                           "onCompleteTarget", gameObject,
                           "onUpdate", "OnFadeBrokenGlass",
                           "onUpdateTarget", gameObject
                           ));
    }
    public IEnumerator DoCallback(ScreenFadeCallBack callback, CanvasGroup canvasGroup, bool activate, float delay)
    {
        yield return(new WaitForSeconds(delay));

        if (callback != null)
        {
            callback();
            callback = null;
        }

        if (canvasGroup != null)
        {
            canvasGroup.interactable   = activate;
            canvasGroup.blocksRaycasts = activate;
        }
    }
Beispiel #7
0
    public void FadeOut(AudioSource audioSource, float fadeTime, float delay = 0.0f, ScreenFadeCallBack callback = null)
    {
        fadeOutCallback             = callback;
        currentFadingOutAudioSource = audioSource;

        iTween.ValueTo(currentFadingOutAudioSource.gameObject, iTween.Hash(
                           "from", currentFadingOutAudioSource.volume,
                           "to", 0.0f,
                           "time", fadeTime,
                           "delay", delay,
                           "easetype", "linear",
                           "onComplete", "FadeOutFinished",
                           "onCompleteTarget", gameObject,
                           "onUpdate", "OnFadeOut",
                           "onUpdateTarget", gameObject
                           ));
    }
    public void FadeOut(CanvasGroup canvasGroup, float fadeTime, float delay = 0.0f, ScreenFadeCallBack callback = null)
    {
        fadeOutCallback        = callback;
        currentFadeCanvasGroup = canvasGroup;

        iTween.ValueTo(currentFadeCanvasGroup.gameObject, iTween.Hash(
                           "from", 1.0f,
                           "to", 0.0f,
                           "time", fadeOutTime,
                           "delay", delay,
                           "easetype", "linear",
                           "onComplete", "FadeOutFinished",
                           "onCompleteTarget", gameObject,
                           "onUpdate", "OnFade",
                           "onUpdateTarget", gameObject
                           ));
    }
    public void FadeOut(CanvasGroup canvasGroup, float fadeTime, float delay = 0.0f, ScreenFadeCallBack callback = null)
    {
        if (canvasGroup.alpha <= 0.0f)
        {
            return;
        }

        //StartCoroutine(OnFading(canvasGroup, fadeTime, delay));
        StartCoroutine(DoCallback(callback, canvasGroup, false, delay + fadeTime));

        iTween.ValueTo(canvasGroup.gameObject, iTween.Hash(
                           "from", 1.0f,
                           "to", 0.0f,
                           "time", fadeTime,
                           "delay", delay,
                           "easetype", "linear",
                           "onComplete", "FadeOutFinished",
                           "onCompleteTarget", gameObject,
                           "onUpdate", "Fade" + canvasGroup.name,
                           "onUpdateTarget", gameObject
                           ));

        Debug.Log("Fade" + canvasGroup.name);
    }
 public void DisableMainUI(float delay = 0.5f, ScreenFadeCallBack callback = null)
 {
     FadeOut(mainUICanvas, generalFadeOutTime, delay, callback);
 }
 public void EnableUI(float delay = 0.5f, ScreenFadeCallBack callback = null)
 {
     FadeIn(mainCanvas, generalFadeInTime, delay, callback);
     ShowButtons(delay + generalFadeInTime);
 }