Ejemplo n.º 1
0
    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));
    }
Ejemplo n.º 2
0
    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));
        }
    }