private void Awake() { dataDialog = GameObject.Find(DataDialogScript.DataDialogName).GetComponent <DataDialogScript>(); progressBar = transform.Find("ChildIndicatorPanel").GetComponentInChildren <BarScript>(); progressBar.transform.localPosition -= new Vector3(progressBar.gameObject.GetComponent <SpriteRenderer>().sprite.bounds.extents.x, 0, 0); onCompleteSound = GameObject.Find("InteractableBuildings").GetComponent <AudioSource>(); }
// Use this for initialization private void Awake() { if (dataDialog == null) { dataDialog = GameObject.Find(DataDialogScript.DataDialogName).GetComponent <DataDialogScript>(); } }