void Start() { GameObject door = GameObject.FindGameObjectWithTag("Door"); tSystem = door.GetComponent <TimeSystem>(); nSystem = gameObject.GetComponent <NourishmentSystem>(); pInfo = FindObjectOfType <Canvas>(); player = FindObjectOfType <Player>(); }
void Start() { Debug.Log(tuFlowchart.GetVariable("isDone")); player.fAmount = 2; player.wAmount = 3; tSystem.isTutorial = true; GameObject p = Resources.Load <GameObject>("Prefabs/Plant"); GameObject plantObject = Instantiate(p); plant = plantObject.GetComponent <Plant>(); plant.transform.position = new Vector3(5.81f, -1.38f, -5f); plant.flowchart = tuFlowchart; nSystem = plant.GetComponent <NourishmentSystem>(); plant.SyncWaterAndFertilizer(nSystem.water, nSystem.fertilizer); }
private void CreatePlant() { numberOfPlants++; // Create and add plant to currentPlants[] Debug.Log("Creating Plant..."); Plant plant; GameObject p = Resources.Load <GameObject>("Prefabs/Plant"); GameObject plantObject = Instantiate(p); plant = plantObject.GetComponent <Plant>(); NourishmentSystem nSystem = plant.GetComponent <NourishmentSystem>(); nSystem.gameObject.SetActive(true); nSystem.plantNumber = numberOfPlants; plant.SetStory(AssignStory()); // Seeting Spawn Location Coordinates var(tempX, tempY) = AssignOpenLocation(); plant.SetLocation(tempX, tempY); currentPlants[numberOfPlants] = plant; Debug.Log("currentPlants: " + currentPlants[numberOfPlants]); Debug.Log("Current # of plants: " + numberOfPlants); }