i am having trouble with an array and the GUI element (icon of the spell equipped) that i want to show.
i must admit i never used arrays before, but i made this, and made it show the icon, but it stacks all 3 on top of eachother!
how do i make it so that every time there is a new one it moves down the screen 40 pixel? so i can actually see all 3 ^^ thanks alot in advance!!
using UnityEngine;
using System.Collections;
public class spellsEquipped : MonoBehaviour {
public GameObject[] EquippedSpells = new GameObject[3];
public int i = 0;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI () {
for (i = 0; i < EquippedSpells.Length; i++){
if (GUI.Button(new Rect(100 ,100,35,35),EquippedSpells*.GetComponentInChildren<spellonprefab>().icon))*
-
print (i);*
-
}*
-
}*
}