示例#1
0
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();

            grid   = (target as InventoryGrid);
            parent = grid.transform.parent.GetComponent <RectTransform>();

            triger = GUILayout.Toggle(triger, "Resize parent");

            try {
                Refresh();
            } catch (InvalidOperationException prefabException) {
                Debug.LogError("No Panic-" + prefabException.Message);
            }

            if (GUILayout.Button("Создать - обновить сетку"))
            {
                Refresh();
                grid.ConstructGrid();
            }
            if (GUILayout.Button("Удалить сетку"))
            {
                grid.DisposeGrid();
            }
        }