// Use this for initialization void Awake() { text_GameOver = GameObject.Find("Text_GameOver").GetComponent <Text>(); text_ReStart = GameObject.Find("Text_ReStart").GetComponent <Text>(); text_Quit = GameObject.Find("Text_Quit").GetComponent <Text>(); button_ReStart = GameObject.Find("Button_ReStart").GetComponent <Button>(); button_Stop = GameObject.Find("Button_Stop").GetComponent <Button>(); button_Quit = GameObject.Find("Button_Quit").GetComponent <Button>(); gameOverScreen = GameObject.Find("GameOver").GetComponent <Image>(); newBoxController = gameObject.GetComponent <NewBoxController>(); cameraController = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <CameraController>(); playerMovement = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>(); image_Stop = GameObject.Find("Button_Stop").GetComponent <Image>(); }
void Awake() { text_GameOver = GameObject.Find("Text_GameOver").GetComponent <Text>(); text_ReStart = GameObject.Find("Text_ReStart").GetComponent <Text>(); text_Quit = GameObject.Find("Text_Quit").GetComponent <Text>(); gameOverScreen = GameObject.Find("GameOver").GetComponent <Image>(); newBoxController = GameObject.FindGameObjectWithTag("GameController").GetComponent <NewBoxController>(); playerMovement = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerMovement>(); button_Stop = GameObject.Find("Button_Stop").GetComponent <Button>(); image_Stop = GameObject.Find("Button_Stop").GetComponent <Image>(); button_Quit = GameObject.Find("Button_Quit").GetComponent <Button>(); restart = gameObject.GetComponent <Button>(); restart.onClick.AddListener(OnClick); }
//private StopButton stopButton; void Awake() { newBoxController = GameObject.FindGameObjectWithTag("GameController").GetComponent <NewBoxController>(); //stopButton = GameObject.FindGameObjectWithTag("GameController").GetComponent<StopButton>(); }