Ejemplo n.º 1
0
    void IActivatable.Activate(GameObject target)
    {
        // Ignroe doors that are already moving
        // Maybe later change this
        if (isMoving)
        {
            return;
        }

        // Check if the door is locked
        if (lockData.CheckLock(target, "LockedDoor"))
        {
            return;
        }

        if (isOpen)
        {
            record.CloseSound?.PlaySoundAtPoint(transform.position);
            StartCoroutine(Close());
        }
        else
        {
            record.OpenSound?.PlaySoundAtPoint(transform.position);
            StartCoroutine(Open());
        }

        OpenDoor(target.transform);
    }
Ejemplo n.º 2
0
    void IActivatable.Activate(GameObject target)
    {
        if (lockData.CheckLock(target, "LockedChest"))
        {
            return;
        }

        // Get the target inventory from whatever activated this inventory
        var targetInventory = target.GetComponent <IInventory>();

        ContainerContentsUI.Create(record.FullName, this, targetInventory);
    }