public void Init() { hasStarted = false; currentTimeBeforeStart = 0f; //ui finishUI.SetActive(false); pauseUI.SetActive(false); settingsToggle.interactable = true; settingsToggle.onValueChanged.AddListener(Settings_OnValueChanged); txtTimer.text = (timeSinceStart).ToString("0.0"); //game gameConfig = FindObjectOfType <GameConfig>(); if (gameConfig == null) { Debug.LogWarning("[GameManager] no game config found, creating"); GameObject temp = Instantiate(gameConfigPrefab); gameConfig = temp.GetComponentInChildren <GameConfig>(); } timerObject.SetActive(gameConfig.showTimer); herd.Init(); herd.AddSheeps(gameConfig.nbSheeps); maxNbSheeps.text = herd.GetNbSheeps().ToString(); currentNbSheeps.text = enclosure.GetNumberOfSheepsInside().ToString(); smartCamera.Init(); isInit = true; }
public void Start() { GameObject[] objs = GameObject.FindGameObjectsWithTag("focusMesh"); _camera.Init(objs); }