// Tool Bar Module loaders public void StartAddPlantModule() { if (AddPlantExpanded == false) { // Instantiate module GameObject module = Instantiate(AddPlantModulePrefab) as GameObject; AddPlantModule script = module.GetComponent <AddPlantModule> (); //shiftin prefab to adding to addplat button module.transform.SetParent(GameObject.FindGameObjectWithTag("AddPlantPanel").transform, false); module.transform.SetAsFirstSibling(); HarvestPanel.SetActive(false); AdjustPanel.SetActive(false); DownloadPanel.SetActive(false); // Set active object script.activeObject = activeObject.GetComponent <FarmObject> (); // Set AddPlantButton script.AddPlantButton = AddPlantButton; // Set BaseURL script.baseURL = GameObject.FindGameObjectWithTag("GameController").GetComponent <MainSystemViewManager> ().BaseURL; // Call initializer script.StartCoroutine("Initialize"); AddPlantExpanded = true; return; } if (AddPlantExpanded == true) { GameObject.FindWithTag("AddPlantModule").GetComponent <AddPlantModule>().DoneButtonPress(); AddPlantExpanded = false; return; } }