void Start() { actionControllerScript = GameObject.Find("ActionController").GetComponent <ActionControllerScript>(); audioSource = GetComponent <AudioSource>(); startingScale = transform.localScale; IsCorrect = false; // Get child references foreach (Transform child in transform) { if (child.tag == "Wall") { Walls.Add(child.gameObject); } if (child.name == "Image") { image = child.gameObject; } if (child.name == "Background") { background = child.gameObject; } if (child.name == "Light") { light = child.gameObject; } } if (light != null) { light.GetComponent <Light>().range = 2.6F; Debug.Log("Light Range: " + light.GetComponent <Light>().range); Debug.Log("Rect Width: " + gameObject.GetComponent <RectTransform>().rect.width); } }
void Start() { actionControllerScript = GameObject.Find("ActionController").GetComponent <ActionControllerScript>(); }