I have created an empty gameobject and dragged four scripts onto it to control various things. One of them has no check-box next to it in the inspector and one of the others isn't being instantiated properly, meaning I'm getting an error:
NullReferenceException: Object reference not set to an instance of an object
I am referencing them like this:
public class DataLayer : MonoBehaviour {
private Configs configOb;
private PageLoader pl;
void Start()
{
configOb = (Configs)gameObject.GetComponent(typeof(Configs));
//configOb = new Configs();
//pl = new PageLoader();
pl = (PageLoader)gameObject.GetComponent(typeof(PageLoader));
}
public ArrayList getTopApps() {
ArrayList titleArray = new ArrayList();
string fetchUrl = configOb.getRoot()+"TopTen.php";
When I test this code it fails at the bottom line because the configOb is null.