public override void InitiatePickup() { PlayerVariables.HeldKey = addedKey; string KeyText = PlayerVariables.GetKeyName(addedKey); if (attachedLight) { StartCoroutine(FadeLight()); } StartCoroutine(PlayerVariables.ShowText(KeyText + " key acquired!", 5f - 2 * PlayerVariables.UITextAnimation.length)); }
public override void Interact() { if (activated) { return; } if ((int)PlayerVariables.HeldKey == (int)requiredKey) { base.Interact(); doorScript.Open(); StartCoroutine(PlayerVariables.ShowText("Door unlocked", 5f)); } else { string requiredKeyText = PlayerVariables.GetKeyName(requiredKey); StartCoroutine(PlayerVariables.ShowText(requiredKeyText + " key required", 5f)); } }