public override void Reset() { base.Reset(); Count++; OnCountChanged?.Invoke(); }
public void Remove(WorkspaceEntry entry) { _entries.Remove(entry); Destroy(entry.Base.gameObject); OnCountChanged?.Invoke(); OnEntryRemoved?.Invoke(entry); }
public void Remove(Entry entry) { _entries.Remove(entry); OnCountChanged?.Invoke(); OnEntryRemoved?.Invoke(entry); entry.OnVisableChanged -= invokeOnVisableCountChanged; invokeOnVisableCountChanged(); }
public void Add(Entry entry) { _entries.Add(entry); entry.Base.SetParent(_hook, false); entry.OnVisableChanged += invokeOnVisableCountChanged; OnCountChanged?.Invoke(); OnEntryAdded?.Invoke(entry); }
void OnResourceChanged() { OnCountChanged?.Invoke(_count); if (_count <= 0f) { OnEmpty(); } }
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(); }
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); }
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); }
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(); }