Inheritance: MonoBehaviour
 public virtual void ShowStars()
 {
     if (LabelObject != null)
     {
         LabelObject.SetActive(true);
     }
     if (!IsLocked)
     {
         if (UnlockedObject != null)
         {
             UnlockedObject.SetActive(true);
         }
         if (LockedObject != null)
         {
             LockedObject.SetActive(false);
         }
     }
     else
     {
         if (UnlockedObject != null)
         {
             UnlockedObject.SetActive(false);
         }
         if (LockedObject != null)
         {
             LockedObject.SetActive(true);
         }
     }
 }
Beispiel #2
0
        public void shouldReleaseLockOnDispose()
        {
            object obj = new object(), mutex = new object();

            using (var locked = new LockedObject <object>(obj, mutex)) {}
            Assert.False(Monitor.IsEntered(mutex));
        }
 // Start is called before the first frame update
 void Start()
 {
     doorObj         = transform.parent.Find("Door").GetComponent <LockedObject>();
     initKeyPosition = transform.position;
     origParent      = transform.parent;
     //doorCollider = doorObj.GetComponent<BoxCollider2D>
 }
Beispiel #4
0
        public void shouldTakeLockOnConstruct()
        {
            object obj = new object(), mutex = new object();

            using (var locked = new LockedObject <object>(obj, mutex)) {
                Assert.True(Monitor.IsEntered(mutex));
            }
        }
Beispiel #5
0
        public void shouldGetObject()
        {
            object obj = new object(), mutex = new object();

            using (var locked = new LockedObject <object>(obj, mutex)) {
                Assert.Same(locked.value, obj);
            }
        }
Beispiel #6
0
        public void shouldNotLockIfLockObjIsNull()
        {
            object obj = new object();

            using (var locked = new LockedObject <object>(obj, null)) {
                Assert.False(Monitor.IsEntered(obj));
            }
        }
 public InteractionLockedObject(LockedObject obj)
 {
     lockedObject = obj;
     Start();
 }