Example #1
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);
        }
Example #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 ConditionsMet(ModuleDataModel dataModel)
 {
     // Conditions are not even checked if the layer isn't enabled
     return(Enabled && LayerCondition.ConditionsMet(this, dataModel));
 }