/******************************************/ /* */ /* Copyright (c) 2018 monitor1394 */ /* https://github.com/monitor1394 */ /* */ /******************************************/ using UnityEngine; using UnityEngine.UI; namespace XCharts { [DisallowMultipleComponent] [ExecuteInEditMode] public class Demo_Test : MonoBehaviour { LineChart chart; void Awake() { chart = gameObject.GetComponent(); if (chart == null) { chart = gameObject.AddComponent(); } var buttom = transform.parent.gameObject.GetComponentInChildren