public bool Register(CriMonoBehaviour criMonoBehaviour) { lock (criMonoBehaviourList) { if (GetIndex(criMonoBehaviour) >= 0) { UnityEngine.Debug.LogWarning("[CRIWARE] Internal: Duplicated CriMonoBehaviour GUID"); return(false); } criMonoBehaviourList.Add(criMonoBehaviour); } return(true); }
public static bool UnRegister(CriMonoBehaviour criMonoBehaviour) { lock (criMonoBehaviourList) { int index = GetIndex(criMonoBehaviour); if (index < 0) { return(false); } criMonoBehaviourList.RemoveAt(index); } return(true); }
private static int GetIndex(CriMonoBehaviour criMonoBehaviour) { return(criMonoBehaviourList.FindIndex(x => (x.guid == criMonoBehaviour.guid))); }