Game Development Reference
In-Depth Information
for (var i: int = 0; i < itemCount; i++) {
itemsContent[i] = (i == 0) ? new
GUIContent(_skillBoxTexture) : new
GUIContent(textures[i-1]);
}
var newView : Rect = SKILL_BOX_RECT;
newView.width *= itemCount;
_scrollPosition = GUI.BeginScrollView (SKILL_BOX_POS,
_scrollPosition, newView);
newView,y = 4;
_selectedSkill = GUI.SelectionGrid (newView,
_selectedSkill, itemsContent, itemCount,
GUI.skin.GetStyle("Selected Item"));
GUI.EndScrollView ();
_guiContent = (_selectedSkill > 0) ?
itemsContent[_selectedSkill] : new GUIContent("");
}
// C# user:
public void Init ( Texture skillBoxTexture ) {
}
public void SetupSkillScrollBar () {
int itemCount = _textureCount+1;
GUIContent[] itemsContent = new
GUIContent[itemCount];
for (int i = 0; i < itemCount; i++) {
itemsContent[i] = (i == 0) ? new
GUIContent(_skillBoxTexture) : new
GUIContent(textures[i-1]);
}
Rect newView = SKILL_BOX_RECT;
newView.width *= itemCount;
_scrollPosition = GUI.BeginScrollView
(SKILL_BOX_POS, _scrollPosition, newView);
newView.y = 4;
_selectedSkill = GUI.SelectionGrid (newView,
Search WWH ::




Custom Search