示例#1
0
    public void ClearCursors()
    {
        // Disable cursors
        gridCursor.DisableCursor();
        cursor.DisableCursor();

        // select nothing
        gridCursor.SelectedItemType = ItemType.none;
        cursor.SelectedItemType     = ItemType.none;
    }
    private void ClearCursors()
    {
        // Disable cursor
        gridCursor.DisableCursor();
        cursor.DisableCursor();

        // Set item type to none
        gridCursor.SelectedItemType = ItemType.none;
        cursor.SelectedItemType     = ItemType.none;
    }
示例#3
0
    // This will disable the cursor and set the selected item type to none
    private void ClearCursors()
    {
        // Disable the gridCursor and the cursor
        gridCursor.DisableCursor();
        cursor.DisableCursor();

        // Set Item Type to none for both cursors
        gridCursor.SelectedItemType = ItemType.none;
        cursor.SelectedItemType     = ItemType.none;
    }
示例#4
0
    private void SetSelectedItem()
    {
        // Clear currently highlighted items
        inventoryBar.ClearHighlightOnInventorySlots();

        // Highlight item on inventory bar
        isSelected = true;

        // Set highlighted inventory slots
        inventoryBar.SetHighlightedInventorySlots();

        // Store the item's use radius for the cursors
        gridCursor.ItemUseGridRadius = itemDetails.itemUseGridRadius;
        cursor.ItemUseRadius         = itemDetails.itemUseRadius;

        // If the item's itemUseGridRadius is greater than 0 we want to enable the grid cursor, else disable it
        if (itemDetails.itemUseGridRadius > 0)
        {
            gridCursor.EnableCursor();
        }
        else
        {
            gridCursor.DisableCursor();
        }

        // If the item's itemUseRadius is greater than 0 we want to enable the grid cursor, else disable it
        if (itemDetails.itemUseRadius > 0f)
        {
            cursor.EnableCursor();
        }
        else
        {
            cursor.DisableCursor();
        }


        // Set the cursors' SelectedItemType to the item's itemType
        gridCursor.SelectedItemType = itemDetails.itemType;
        cursor.SelectedItemType     = itemDetails.itemType;

        // Set item selected in inventory
        InventoryManager.Instance.SetSelectedInventoryItem(InventoryLocation.player, itemDetails.itemCode);

        if (itemDetails.canBeCarried == true)
        {
            Player.Instance.ShowCarriedItem(itemDetails.itemCode);
        }
        else
        {
            Player.Instance.ClearCarriedItem();
        }
    }