Ejemplo n.º 1
0
        public void AddOnceRemovesTheCallbackAfterInvokation()
        {
            var evnt      = new UnityEvent();
            var callCount = 0;

            evnt.AddOnce(() =>
            {
                callCount++;
            });
            evnt.Invoke();
            evnt.Invoke(); // second invoke shouldnt call the handler
            Assert.AreEqual(1, callCount);
        }