Пример #1
0
    public override void Reset()
    {
        base.Reset();

        Count++;
        OnCountChanged?.Invoke();
    }
Пример #2
0
        public void Remove(WorkspaceEntry entry)
        {
            _entries.Remove(entry);
            Destroy(entry.Base.gameObject);

            OnCountChanged?.Invoke();
            OnEntryRemoved?.Invoke(entry);
        }
Пример #3
0
 public void Remove(Entry entry)
 {
     _entries.Remove(entry);
     OnCountChanged?.Invoke();
     OnEntryRemoved?.Invoke(entry);
     entry.OnVisableChanged -= invokeOnVisableCountChanged;
     invokeOnVisableCountChanged();
 }
Пример #4
0
 public void Add(Entry entry)
 {
     _entries.Add(entry);
     entry.Base.SetParent(_hook, false);
     entry.OnVisableChanged += invokeOnVisableCountChanged;
     OnCountChanged?.Invoke();
     OnEntryAdded?.Invoke(entry);
 }
Пример #5
0
    void OnResourceChanged()
    {
        OnCountChanged?.Invoke(_count);

        if (_count <= 0f)
        {
            OnEmpty();
        }
    }
Пример #6
0
 private void OnAntCountChangedHandler()
 {
     if (HasUnitsOfType)
     {
         var maxCount = GameplayManager.Instance.Player.Anter.GetFreeAnts(types[antType.value - 1]);
         antCount.value = Mathf.FloorToInt(maxCount * antCountSlider.value);
     }
     else
     {
         antCount.value = 0;
     }
     OnCountChanged?.Invoke();
 }
Пример #7
0
    public override bool Hit(Bullet bullet, RaycastHit hit)
    {
        if (base.Hit(bullet, hit))
        {
            Count--;
            OnCountChanged?.Invoke();

            if (Count == 0)
            {
                OnAllKilled?.Invoke();
            }

            return(true);
        }

        return(false);
    }
Пример #8
0
        public void Add(WorkspaceEntry entry, Vector2 screenPos)
        {
            _entries.Add(entry);
            entry.Base.SetParent(_hook, true);
            Vector2 rectPoint;

            RectTransformUtility.ScreenPointToLocalPointInRectangle(Content, screenPos, GetComponentInParent <Canvas>().worldCamera, out rectPoint);
            Vector2 normalized = Rect.PointToNormalized(Content.rect, rectPoint);

            entry.Base.anchorMin           = normalized;
            entry.Base.anchorMax           = normalized;
            entry.Base.anchoredPosition    = Vector2.zero;
            entry.Base.localScale          = Vector3.one;
            entry.CursorFollower.Container = Content;

            OnCountChanged?.Invoke();
            OnEntryAdded?.Invoke(entry);
        }
Пример #9
0
 public static void SetCount(int value)
 {
     Count = value;
     OnCountChanged?.Invoke();
 }
 public void ResetCounter()
 {
     this.state.CurrentCount = 0;
     OnCountChanged?.Invoke();
 }
 public void IncrementCounter()
 {
     this.state.CurrentCount++;
     OnCountChanged?.Invoke();
 }