Game Development Reference
In-Depth Information
Engage thrusters
We will start with adding the parameters by performing the following steps, which we will
use to store the data in our INVENTORY page:
1. Open the ItemsContainer class; now, we will create the item's array object
and the scroll view that can contain all the items; firstly, add the following high-
lighted code to create new variables:
// Unity JavaScript user:
#pragma strict
import System.Collections.Generic;
private var _isEquipment : boolean;
private final var ITEM_BOX_POS : Rect = new Rect (257,
87, 320, 200);
private final var TOOL_BOX_RECT : Rect = new Rect (0,
0, 280, 40);
private final var EQUIP_BOX_POS : Rect = new Rect
(257, 300, 320, 120);
var items : List.<Item>;
private var _itemCount : int;
private var _selectedItem : int;
private var _scrollPosition : Vector2;
function get guiContent () : GUIContent {
// C# user:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
bool _isEquipment;
readonly Rect ITEM_BOX_POS = new Rect (257, 87, 320,
200);
readonly Rect TOOL_BOX_RECT = new Rect (0, 0, 280, 40);
Search WWH ::




Custom Search