public void SubscribeToConditionChange(ConditionChange onChange, VisibilityCondition.Condition condition)
 {
     if (condition == VisibilityCondition.Condition.None)
     {
         throw new ArgumentException(string.Format("Invalid Condition '{0}'", condition));
     }
     if (this.m_levelManager == null)
     {
         this.m_levelManager = UnityEngine.Object.FindObjectOfType <LevelManager>();
     }
     this.InitializeConditions();
     ConditionChange[] array = this.events;
     array[(int)condition] = (ConditionChange)Delegate.Combine(array[(int)condition], onChange);
     this.previousConditions[(int)condition] = this.check[(int)condition]();
     onChange(condition, this.previousConditions[(int)condition]);
 }
 public void UnsubscribeToConditionChange(ConditionChange onChange, VisibilityCondition.Condition condition)
 {
     ConditionChange[] array = this.events;
     array[(int)condition] = (ConditionChange)Delegate.Remove(array[(int)condition], onChange);
 }
Beispiel #3
0
 private void ConditionComboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     Notifier.Condition = (Condition)ConditionComboBox.SelectedIndex;
     ConditionChange?.Invoke(Notifier, Notifier.Condition);
 }