Hi guys i wonder why my gameobjects arent reactivating in the update function.
basically i just want to disable the gameobjects at the start, and after some time i want to re-enable it.
void Start(){
diffText = GameObject.Find ("Diff_lbl").GetComponent<TextMesh> ();
timeText = GameObject.Find ("Time_lbl").GetComponent<TextMesh> ();
astroCountText = GameObject.Find ("Astronaut_lbl").GetComponent<TextMesh> ();
resumePauseStateText = GameObject.Find ("ResumePause_lbl").GetComponent<TextMesh> ();
//these gameobjects are grandschildren of the gameobject this script is attached to
agileMarker = GameObject.Find ("FrameMarkerAgile");
balancerMarker = GameObject.Find ("FrameMarkerBalancer");
titanMarker = GameObject.Find ("FrameMarkerTitan");
agileMarker.SetActive (false);
balancerMarker.SetActive (false);
titanMarker.SetActive (false);
}
// Update is called once per frame
void Update(){
if (GameManager.instance.isCasual) {
diffText.text = "Casual";
} else {
diffText.text = "Hardcore";
}
if(GameManager.instance.isGameStarted) {
astroCountText.text = GameManager.instance.astronautCount.ToString ();
agileMarker.SetActive (true);
seconds = Mathf.Floor(Time.time);
timeText.text = seconds.ToString ();
if (seconds >= 10) {
balancerMarker.SetActive (true);
}
if (seconds >= 20) {
titanMarker.SetActive (true);
}
}
if (Time.timeScale == 0) {
resumePauseStateText.text = "Resume";
}
if (Time.timeScale == 1) {
resumePauseStateText.text = "Pause";
}
}