Exemplo n.º 1
0
    public override void Reset()
    {
        base.Reset();

        Count++;
        OnCountChanged?.Invoke();
    }
Exemplo n.º 2
0
        public void Remove(WorkspaceEntry entry)
        {
            _entries.Remove(entry);
            Destroy(entry.Base.gameObject);

            OnCountChanged?.Invoke();
            OnEntryRemoved?.Invoke(entry);
        }
Exemplo n.º 3
0
 public void Remove(Entry entry)
 {
     _entries.Remove(entry);
     OnCountChanged?.Invoke();
     OnEntryRemoved?.Invoke(entry);
     entry.OnVisableChanged -= invokeOnVisableCountChanged;
     invokeOnVisableCountChanged();
 }
Exemplo n.º 4
0
 public void Add(Entry entry)
 {
     _entries.Add(entry);
     entry.Base.SetParent(_hook, false);
     entry.OnVisableChanged += invokeOnVisableCountChanged;
     OnCountChanged?.Invoke();
     OnEntryAdded?.Invoke(entry);
 }
Exemplo n.º 5
0
    void OnResourceChanged()
    {
        OnCountChanged?.Invoke(_count);

        if (_count <= 0f)
        {
            OnEmpty();
        }
    }
Exemplo n.º 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();
 }
Exemplo n.º 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);
    }
Exemplo n.º 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);
        }
Exemplo n.º 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();
 }