void Awake() { act3Check = GameObject.Find("Player").GetComponent <NewAct3>(); //act3a = GameObject.Find ("QUEST_INDICATOR").GetComponent<QUEST> //NotificationCentre.AddObserver(this,"QuestStatus"); //get a list of gameobject with tag qIndicator var aObjects = GameObject.FindGameObjectsWithTag("qIndicator"); //redefine the list to array var qObject = new GameObject[aObjects.Length]; //save the qobjects into the array for easy access when deactivated for (int i = 0; i < aObjects.Length; i++) { qObject[i] = aObjects[i]; Debug.Log("object =" + qObject[i].name + "'s current state in scene is" + qObject[i].activeInHierarchy + " and object0 is" + qObject[i]); } aObject[0].renderer.enabled = false; aObject[1].renderer.enabled = false; aObject[2].renderer.enabled = false; }
void Update() { act3part1 = GameObject.Find("Player").GetComponent <NewAct3>(); }