Hello guys, I am new to scripting. I had an inventory script in Javascript created by the Slayer and I converted it to C#, however, although every debug.log’s I do in general dont give me a null references, and even reporting me that the textures are there, they are simply not showing up! What do I miss here ?
using UnityEngine;
using System.Collections;
//using System.Linq;
public class Player_Inventory_Csharp : MonoBehaviour {
public static string[] itemID = {"Oak Wood", "Palm Wood", "Stone", "Iron Bar"};
[System.NonSerialized]
public int[] itemPlayersAmount = new int[4]{0, 0, 0, 0};
public Texture[] itemTexture = new Texture[itemID.Length];//= { new Texture{spelen.itemID.Length}, new Texture{spelen.itemID.Length}};
void Awake(){
Texture2D[] textures = Resources.LoadAll<Texture2D>("Item_Icons");
for ( int i = 0; i < itemTexture.Length; i++)
{
itemTexture[i] = textures[i];Debug.Log(itemTexture);
}
}
}