// Use this for initialization void Start() { var textWithActions = transform.Find("Canvas").gameObject; this.canvasBehavior = textWithActions.GetComponent <CanvasWithActionsBehavior>(); textWithActions.SetActive(false); }
// Use this for initialization void Start() { var textWithActions = transform.Find("Canvas").gameObject; var imageBackground = textWithActions.transform.Find("Image"); var nameText = imageBackground.Find("Name").gameObject; nameText.GetComponent <Text>().text = this.speaker; this.textComponent = imageBackground.Find("Text").gameObject; var button = imageBackground.Find("Button"); this.buttonTextComponent = button.Find("Text").gameObject; this.canvasBehavior = textWithActions.GetComponent <CanvasWithActionsBehavior>(); textWithActions.SetActive(false); }