コード例 #1
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            SwitchGrid script = (SwitchGrid)target;

            if (GUILayout.Button("Create grid"))
            {
                script.CreateGrid();
            }
            else if (GUILayout.Button("Clear grid"))
            {
                script.ClearGrid();
            }
        }
コード例 #2
0
        protected override void Awake()
        {
            base.Awake();

            switchGrid = GetComponentInParent <SwitchGrid>();
        }