private void ToggleState() { isOn = !isOn; spriteHandler.ChangeSprite(isOn ? (int)SpriteState.On : (int)SpriteState.Off); UIActionManager.SetSpriteSO(this, spriteHandler.GetCurrentSpriteSO()); pickupable.RefreshUISlotImage(); }
private void UpdateButtonSprite(bool isServer) { if (useSpriteHandler) { UIActionManager.SetSpriteSO(this, spriteHandler.GetCurrentSpriteSO(), networked: isServer, palette: spriteHandler.Palette); } }
private void UpdateButtonSprite(bool isServer) { if (useSpriteHandler) { UIActionManager.SetSpriteSO(this, spriteHandler.GetCurrentSpriteSO(), isServer); } }
public void OnInventoryMoveClient(ClientInventoryMove info) { if (!hasActionButton) { return; } bool shouldShowButton = pickupable.ItemSlot != null && pickupable.ItemSlot.Player != null && info.ClientInventoryMoveType == ClientInventoryMoveType.Added; if (!shouldShowButton) { UIActionManager.ToggleLocal(this, false); return; } // If the slot the item is a slot of the client's. if (pickupable.ItemSlot.LocalUISlot != null) { UIActionManager.ToggleLocal(this, true); UIActionManager.SetSpriteSO(this, spriteHandler.GetCurrentSpriteSO(), false); } }
private void SpriteHandlerSOChanged(SpriteDataSO obj) { UIActionManager.SetSpriteSO(this, spriteHandler.GetCurrentSpriteSO(), false, spriteHandler.Palette); }