Beispiel #1
0
    public bool CheckAnimationActive(ScriptedAnimationType scriptedAnimationType)
    {
        List <ScriptedAnimation> targetScriptedAnimations = scriptedAnimations.FindAll(x => x.Type == scriptedAnimationType);
        bool animationOfTypeActive = targetScriptedAnimations.Exists(x => x.IsAnimating);

        return(animationOfTypeActive);
    }
Beispiel #2
0
    public void CancelAnimation(ScriptedAnimationType scriptedAnimationType)
    {
        List <ScriptedAnimation> targetScriptedAnimations = scriptedAnimations.FindAll(x => x.Type == scriptedAnimationType);

        foreach (ScriptedAnimation scriptedAnimation in targetScriptedAnimations)
        {
            scriptedAnimation.StopAnimation(false);
        }

        UpdateAreAnimating();
    }
Beispiel #3
0
    public void StartAnimation(ScriptedAnimationType scriptedAnimationType, Action onAnimationCompleted = null)
    {
        ScriptedAnimation scriptedAnimation = scriptedAnimations.Find(x => x.Type == scriptedAnimationType);

        if (scriptedAnimation == null)
        {
            if (onAnimationCompleted != null)
            {
                onAnimationCompleted();
            }
            return;
        }

        onAnimationCompleted += UpdateAreAnimating;

        scriptedAnimation.StartAnimation(() => {
            if (onAnimationCompleted != null)
            {
                onAnimationCompleted();
            }
        });

        UpdateAreAnimating();
    }
Beispiel #4
0
    private ScriptedAnimation GetLevelNodeAnimation(ScriptedAnimationType scriptedAnimationType)
    {
        ScriptedAnimation scriptedAnimation = scriptedAnimations.Find(x => x.Type == scriptedAnimationType);

        return(scriptedAnimation);
    }