Exemple #1
0
 public void DeleteTriggerHolder(TriggerHolder holder)
 {
     if (!holder || !holders.ContainsKey(holder.ID))
     {
         return;
     }
     holders.Remove(holder.ID);
     if (OnTriggerSetEvent != null)
     {
         OnTriggerSetEvent -= holder.OnTriggerSet;
     }
 }
Exemple #2
0
 public void RegisterTriggerHolder(TriggerHolder holder)
 {
     if (!holder && holders.ContainsKey(holder.ID))
     {
         return;
     }
     OnTriggerSetEvent += holder.OnTriggerSet;
     if (triggers.TryGetValue(holder.TriggerName, out var state))
     {
         holder.OnTriggerSet(holder.name, state == TriggerState.On ? true : false);
     }
     holders.Add(holder.ID, holder);
 }
Exemple #3
0
 public TriggerHolderData(TriggerHolder holder)
 {
     ID           = holder.ID;
     isSetAtFirst = holder.isSetAtFirst;
 }
Exemple #4
0
 // Use this for initialization
 void Start()
 {
     _instance = this;
     DontDestroyOnLoad(gameObject);
 }