LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/ClipboardItem.cs

72 lines
1.4 KiB
C#
Raw Normal View History

2023-12-22 22:51:17 +00:00
using UnityEngine;
public class ClipboardItem : GrabbableObject
{
public int currentPage = 1;
public Animator clipboardAnimator;
public AudioClip[] turnPageSFX;
public AudioSource thisAudio;
public override void PocketItem()
{
if (base.IsOwner && playerHeldBy != null)
{
playerHeldBy.equippedUsableItemQE = false;
isBeingUsed = false;
}
base.PocketItem();
}
public override void ItemInteractLeftRight(bool right)
{
int num = currentPage;
RequireCooldown();
if (right)
{
currentPage = Mathf.Clamp(currentPage + 1, 1, 4);
}
else
{
currentPage = Mathf.Clamp(currentPage - 1, 1, 4);
}
if (currentPage != num)
{
RoundManager.PlayRandomClip(thisAudio, turnPageSFX);
}
clipboardAnimator.SetInteger("page", currentPage);
}
public override void DiscardItem()
{
if (playerHeldBy != null)
{
playerHeldBy.equippedUsableItemQE = false;
}
isBeingUsed = false;
base.DiscardItem();
}
public override void EquipItem()
{
base.EquipItem();
playerHeldBy.equippedUsableItemQE = true;
if (base.IsOwner)
{
HUDManager.Instance.DisplayTip("To read the manual:", "Press Z to inspect closely. Press Q and E to flip the pages.", isWarning: false, useSave: true, "LCTip_UseManual");
}
}
protected override void __initializeVariables()
{
base.__initializeVariables();
}
protected internal override string __getTypeName()
{
return "ClipboardItem";
}
}