void Update() { ItemSlotPanel chest_panel = ItemSlotPanel.Get(select.GetUID()); bool open = chest_panel != null && chest_panel.IsVisible(); Quaternion target = open ? Quaternion.Euler(-90f, 0f, 0f) * start_rot : start_rot; chest_lid.localRotation = Quaternion.Slerp(chest_lid.localRotation, target, 10f * Time.deltaTime); if (chest_lid_outline != null) { chest_lid_outline.localRotation = Quaternion.Slerp(chest_lid_outline.localRotation, target, 10f * Time.deltaTime); } }
void Update() { ItemSlotPanel panel = ItemSlotPanel.Get(inventory_target); if (panel != null) { Vector3 wPos = panel.GetSlotWorldPosition(slot_target); DoMoveToward(wPos); InventoryData inventory = panel.GetInventory(); InventoryItemData islot = inventory?.GetItem(slot_target); if (islot == null || islot.GetItem() == null) { Destroy(gameObject); } } timer += Time.deltaTime; if (timer > 2f) { Destroy(gameObject); } }