예제 #1
0
        void Update()
        {
            if (RoomManager.gameSetupComplete && !delayRan)
            {
                DelayedStart();
            }
            Collider2D playerInRange = Physics2D.OverlapCircle(transform.position, 0.55f, playerMask);

            if (playerInRange)
            {
                if (PlayerFacingItem(playerInRange))
                {
                    if (!panelEnabled)
                    {
                        var newText = thisItem.itemName + "\n" + thisItem.itemDesc;
                        itemPanel.ItemPanelSetEnable(newText);
                        panelEnabled = true;
                    }
                    bool pickup = Input.GetButtonDown("Pickup");
                    if (pickup && !ItemWheel.active)
                    {
                        PlayerPickupDrop(playerInRange.gameObject);
                    }
                }
                else
                {
                    if (panelEnabled)
                    {
                        itemPanel.ItemPanelDisabled();
                        panelEnabled = false;
                    }
                }
            }
            else
            {
                if (panelEnabled)
                {
                    itemPanel.ItemPanelDisabled();
                    panelEnabled = false;
                }
            }
        }