/// <summary> /// Open this treasure chest, auto. closes the previous one. /// From an external call use the triggerer. Use() instead. /// </summary> protected virtual void OpenTreasureChest() { if (this != lastChest && lastChest != null) { lastChest.CloseTreasureChest(); } lastChest = this; // Set items lootWindow.SetItems(items, true); window.OnHide += window_OnHide; lootWindow.OnRemovedItem += lootWindow_OnRemovedItem; if (open == false) { window.Show(); open = true; } }