private void _Init() { Debug.Log($"Init {this}"); if (!Application.isPlaying) { return; } Registry[Id] = this; var ids = new HashSet <string>(); foreach (var b in Buyables) { if (ids.Contains(b.Id)) { throw new Exception($"Duplicate id {b.Id}"); } ids.Add(b.Id); if (b.Init(this)) { b.OnAcquireChanged += (sender, args) => OnAcquireChanged?.Invoke(sender, null); } } ConfigureSingleEquipped(); ResetButton.OnGlobalReset += OnReset; }
private void OnReset(object sender, EventArgs eventArgs) { foreach (var b in Buyables) { b.ConfigureDefaults(); } ConfigureSingleEquipped(); OnAcquireChanged?.Invoke(); OnEquipChanged?.Invoke(); }