public void DeleteTriggerHolder(TriggerHolder holder) { if (!holder || !holders.ContainsKey(holder.ID)) { return; } holders.Remove(holder.ID); if (OnTriggerSetEvent != null) { OnTriggerSetEvent -= holder.OnTriggerSet; } }
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); }
public TriggerHolderData(TriggerHolder holder) { ID = holder.ID; isSetAtFirst = holder.isSetAtFirst; }
// Use this for initialization void Start() { _instance = this; DontDestroyOnLoad(gameObject); }