Как сделать инвентарь с 3 хранилищами. Например:
если я нажму кнопку «Хранилище 1», в инвентаре отобразится 20 слотов,
если я нажму Кнопка «Хранилище 2» в инвентаре будет отображаться от 21 до 40 слотов, а
если я нажму кнопку «Хранилище 3», в инвентаре будет отображаться от 41 до 60 слотов.< /p>
так что всего у него есть все 60 слотов.
Ниже мой код:
inventory.cs
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
public class inventory : MonoBehaviour {
public List slotsx = new List ();
public player Player;
public List itemx = new List ();
public GameObject slots;
item itemxs;
public int indexofdragitem;
public Sprite icon;
int sisa;
itemDatabase database;
int totalSlot = 60;
int currentStorage = 1;
int view = 20;
// Use this for initialization
void Start () {
Player = new player();
int slotAmount = 0;
database = GameObject.FindGameObjectWithTag ("itemDatabase").GetComponent ();
//Generate the Slot and Slot Name;
for(int i = 1; i
Подробнее здесь: https://stackoverflow.com/questions/381 ... on-unity-c