Пример #1
0
 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);
 }
Пример #2
0
 public static bool UnRegister(CriMonoBehaviour criMonoBehaviour)
 {
     lock (criMonoBehaviourList) {
         int index = GetIndex(criMonoBehaviour);
         if (index < 0)
         {
             return(false);
         }
         criMonoBehaviourList.RemoveAt(index);
     }
     return(true);
 }
Пример #3
0
 private static int GetIndex(CriMonoBehaviour criMonoBehaviour)
 {
     return(criMonoBehaviourList.FindIndex(x => (x.guid == criMonoBehaviour.guid)));
 }