// Trigger deactivation events
    public void TriggerDeactivated()
    {
        OnDeactivated?.Invoke(this, EventArgs.Empty);

        if (IsActive)
        {
            IsActive = false;
            OnChangedDeactivation?.Invoke(this, EventArgs.Empty);
        }
    }
        private void OnMouseUp(MouseUpEvent evt)
        {
            if (!_active || !target.HasMouseCapture() || !CanStopManipulation(evt))
            {
                return;
            }

            _active = false;
            target.ReleaseMouse();
            OnDeactivated?.Invoke(evt);
            evt.StopPropagation();
        }
Esempio n. 3
0
        public void ResetSound()
        {
            _audioSource.volume = 0f;
            _audioSource.clip   = null;
            _onStopCallback     = null;
            _loopCount          = 0;
            _delayTimer         = null;

            gameObject.SetActive(false);

            OnDeactivated?.Invoke();
        }
Esempio n. 4
0
 private void Start()
 {
     if (blurTrigger == null || blurMaskObject == null)
     {
         return;
     }
     blurTrigger.OnPointerEnterEvent += () =>
     {
         blurMaskObject.SetActive(true);
         OnActivated?.Invoke();
     };
     blurTrigger.OnPointerExitEvent += () =>
     {
         blurMaskObject.SetActive(false);
         OnDeactivated?.Invoke();
     };
 }
Esempio n. 5
0
    private IEnumerator MoveToWorldY(float targetYPos, float duration)
    {
        timeExpired = 0;
        float   startYPos = transform.position.y;
        Vector3 newPos    = transform.position;

        yield return(null);

        while (timeExpired < duration)
        {
            timeExpired       += Time.deltaTime;
            newPos.y           = Mathf.Lerp(startYPos, targetYPos, timeExpired / duration);
            transform.position = newPos;
            yield return(null);
        }

        OnDeactivated?.Invoke();
    }
Esempio n. 6
0
        public void Update()
        {
            entityCache.GetAwaitingActivation().ForEach(entity =>
            {
                var attrs       = entityAttributes[entity.Id.Index];
                attrs.Activated = true;
                OnActivated?.Invoke(this, new EntityEventArgs()
                {
                    Entity = entity
                });
            });

            entityCache.GetAwaitingDeactivation().ForEach(entity =>
            {
                var attrs       = entityAttributes[entity.Id.Index];
                attrs.Activated = false;
                OnDeactivated?.Invoke(this, new EntityEventArgs()
                {
                    Entity = entity
                });
            });

            entityCache.GetZombies().ForEach(entity =>
            {
                OnDestroy?.Invoke(this, new EntityEventArgs()
                {
                    Entity = entity
                });
                entity.Destroy();
                entityCache.RemoveAlive(entity);
                entityAttributes.Remove(entity.Id.Index);
                entityComponents.Remove(entity.Id.Index);
                entityIdPool.Remove(entity.Id);
            });

            entityCache.ClearTemp();
        }
Esempio n. 7
0
 protected void InvokeDeactivated()
 {
     OnDeactivated?.Invoke();
 }
Esempio n. 8
0
 private void Deactivated(object sender, System.EventArgs args)
 {
     Input.Input.Instance?.OnGameDeactivated();
     OnDeactivated?.Invoke();
 }
Esempio n. 9
0
 public static void CallOnDeactivation(int id)
 {
     OnDeactivated?.Invoke(id);
 }
Esempio n. 10
0
 public void NotifyOnDeactivated()
 {
     OnDeactivated?.Invoke(this);
 }
Esempio n. 11
0
 /// <summary>
 /// Процедура деактивации меню/подменю
 /// </summary>
 public virtual void Deactivate()
 {
     IsActive = false;
     OnDeactivated?.Invoke();
 }