Esempio n. 1
0
        public override void Draw(Rect position, GUIContent label)
        {
            var instructionHeight = InstructionDrawer.GetHeight();
            var instructionRect   = RectHelper.TakeHeight(ref position, instructionHeight);

            DrawInstruction(instructionRect, label);
            RectHelper.TakeVerticalSpace(ref position);

            using (new EditorGUI.IndentLevelScope())
            {
                if (_caller.Inputs.Count > 0)
                {
                    var inputsHeight = _inputs.GetHeight();
                    var inputsRect   = RectHelper.TakeHeight(ref position, inputsHeight);

                    _inputs.Draw(inputsRect, _inputsLabel.Content);
                }

                if (_caller.Outputs.Count > 0)
                {
                    var outputsHeight = _outputs.GetHeight();
                    var outputsRect   = RectHelper.TakeHeight(ref position, outputsHeight);

                    _outputs.Draw(outputsRect, _outputsLabel.Content);
                }
            }
        }
Esempio n. 2
0
        private void DrawInstruction(Rect rect, GUIContent label)
        {
            var instruction = InstructionDrawer.Draw(rect, label, _caller.Instruction);

            if (_caller.Instruction != instruction)
            {
                _caller.Instruction = instruction;
                Refresh();
            }
        }
Esempio n. 3
0
        public override float GetHeight(GUIContent label)
        {
            var height = InstructionDrawer.GetHeight();

            if (_caller.Inputs.Count > 0 || _caller.Outputs.Count > 0)
            {
                height += RectHelper.VerticalSpace;
            }

            if (_caller.Inputs.Count > 0)
            {
                height += _inputs.GetHeight();
            }

            if (_caller.Outputs.Count > 0)
            {
                height += _outputs.GetHeight();
            }

            return(height);
        }