Example #1
0
        public override void OnInteracted(LocalPlayer toucher)
        {
            base.OnInteracted(toucher);
            UIInventory chest_25_slot    = UGUIManager.Instance.OpenDialog <UIInventory>("Chest25Slot");
            UIInventory player_inventory = UGUIManager.Instance.OpenDialog <UIInventory>("Player50Slot");

            chest_25_slot.LoadInventory(storage_inventory);
            chest_25_slot.AppendCascadeClosing(player_inventory);
            chest_25_slot.widget_position = new Vector2(-410, 0);

            player_inventory.LoadInventory(toucher.inventory);
            player_inventory.AppendCascadeClosing(chest_25_slot);
            player_inventory.widget_position = new Vector2(210, 0);
        }
Example #2
0
        void Update()
        {
            if (UGUIManager.Instance.NeedShowCursor)
            {
                Cursor.visible = true;
#if UNITY_EDITOR
                Cursor.lockState = CursorLockMode.None;
#else
                Cursor.lockState = CursorLockMode.Confined;
#endif
            }
            else
            {
                Cursor.visible   = false;
                Cursor.lockState = CursorLockMode.Locked;
            }


            if (Input.GetButton("Inventory") && inventory_cool_down <= 0)
            {
                inventory_cool_down = 5;
                if (player.operation_state != EOperationState.Managing_Inventory)
                {
                    UIInventory ui_inventory = UGUIManager.Instance.OpenDialog <UIInventory>("Player50Slot");
                    ui_inventory.LoadInventory(player.inventory);
                }
                else
                {
                    UGUIManager.Instance.CloseDialog("Player50Slot");
                }
            }

            if (inventory_cool_down > 0)
            {
                inventory_cool_down--;
            }

            DetectInteractable();
        }