Beispiel #1
0
 private void OnLayerConditionsMet(object sender, EventArgs eventArgs)
 {
     if (FadeInTime <= 0)
     {
         return;
     }
     if (FadeTweener != null && FadeTweener.Running)
     {
         FadeTweener = new Tweener <float>(FadeTweener.Value, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
     }
     else
     {
         FadeTweener = new Tweener <float>(0, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
     }
     FadeTweener.Start();
 }
Beispiel #2
0
        /// <summary>
        ///     Checks whether this layers conditions are met.
        ///     If they are met and this layer is an event, this also triggers that event.
        /// </summary>
        /// <param name="dataModel"></param>
        /// <returns></returns>
        public bool AreConditionsMet(ModuleDataModel dataModel)
        {
            // Conditions are not even checked if the layer isn't enabled
            if (!Enabled)
            {
                return(false);
            }

            FadeTweener?.Update(40);
            var conditionsMet = LayerCondition.ConditionsMet(this, dataModel);

            if (conditionsMet && !_conditionsMetLastFrame)
            {
                OnLayerConditionsMet();
            }
            if (!conditionsMet && _conditionsMetLastFrame)
            {
                OnLayerConditionsUnmet();
            }

            _conditionsMetLastFrame = conditionsMet;
            return(FadeTweener != null && FadeTweener.Running || conditionsMet);
        }