// Start is called before the first frame update // Acts as a initialzing method. void Start() { var temp = GameObject.FindGameObjectWithTag("DayController"); if (temp != null) { dayController = temp.GetComponent <DayController>(); dayController.Subscribe(this); dayCycle = dayController.GetDayCycle(); //Sets initial state SetSpawnState(); } spawnPoints = FindObjectOfType <MoveSpots>(); }
public void Start() { GameObject temp = GameObject.FindGameObjectWithTag("DayController"); if (temp != null) { dayController = temp.GetComponent <DayController>(); } else { Debug.Log("Can't Find DayController"); } if (dayController != null) { dayController.Subscribe(this); dayCycle = dayController.GetDayCycle(); UpdateIndicator(); } else { Debug.Log("DayController not referenced."); } }