This is simple script to make inventory window(n x 1 matrix). You can change bool variable 'ShowStickList' when user click certain keyboard button then OnGUI method will(or won't) draw a window. Method 'InventoryWindow' makes buttons that each is an item in BindableList in Inventory window. When user click one of those buttons, 'StickReadyToBind()' method will be called


Script above is to make flexible inventory that contains all items in ArrayList. And if you wanna create Inventory fixed size so there are buttons the same number of items and blank squares, this is the script.



This is script that makes m x n matrix inventory. It will create buttons while there are items in the list, then rest will be just simple square(see 'if{} else{}' in the script)

'GUI.DragWindow()' method is to make that inventory dragable. User can move window by click and drag by mouse





'중국인턴(Intern In China) > 업무(Tasks)' 카테고리의 다른 글

Change Color of Z Sticks(Theater Mode)  (0) 2017.01.11
Unity Http Put Json Type  (0) 2017.01.11
Unity HTTP (www) get, put, post  (0) 2017.01.10
Parsing data from Json  (0) 2017.01.10
Loaded Json Data from Server@@@  (0) 2017.01.06

+ Recent posts