I am using six prefabs right now: Cross, Straight, Curve, End, Tee, Blank. All of them load and are able to be instantiated, except for End and Tee, which when I try to instantiate either, give the error “ArgumentException: The prefab you want to instantiate is null.”
I load everything here:
public GameObject fabCross_Tile = Resources.Load("Cross") as GameObject;
public GameObject fabStraight_Tile = Resources.Load("Straight") as GameObject;
public GameObject fabCurve_Tile = Resources.Load("Curve") as GameObject;
public GameObject fabEnd_Tile = Resources.Load("End") as GameObject;
public GameObject fabTee_Tile = Resources.Load("Tee") as GameObject;
public GameObject fabBlank_Tile = Resources.Load("Blank") as GameObject;
I initialize everything here:
public void initialize_cross ()
{
entity = fabCross_Tile;
t_top = 1;
t_right = 1;
t_bottom = 1;
t_left = 1;
print (entity);
}
public void initialize_straight ()
{
entity = fabStraight_Tile;
t_top = 1;
t_right = -1;
t_bottom = 1;
t_left = -1;
print (entity);
}
public void initialize_curve ()
{
entity = fabCurve_Tile;
t_top = 1;
t_right = -1;
t_bottom = -1;
t_left = 1;
print (entity);
}
public void initialize_end ()
{
entity = fabEnd_Tile;
t_top = 1;
t_right = -1;
t_bottom = -1;
t_left = -1;
print (entity);
}
public void initialize_tee ()
{
entity = fabTee_Tile;
t_top = 1;
t_right = 1;
t_bottom = -1;
t_left = 1;
print (entity);
}
public void initialize_blank ()
{
entity = fabBlank_Tile;
t_top = -1;
t_right = -1;
t_bottom = -1;
t_left = -1;
print (entity);
}
At this point, it prints out Null for End and Tee, but the correct values for everything else.