Esempio n. 1
0
        public override void Draw(Rect position, GUIContent label)
        {
            if (Creature.Species != null)
            {
                var speciesHeight = _instructionCaller.GetHeight(null);
                var speciesRect   = RectHelper.TakeHeight(ref position, speciesHeight);

                RectHelper.TakeVerticalSpace(ref position);

                var labelRect = RectHelper.TakeWidth(ref speciesRect, speciesRect.width * 0.25f);
                var editRect  = RectHelper.AdjustHeight(RectHelper.TakeTrailingIcon(ref speciesRect), EditorGUIUtility.singleLineHeight, RectVerticalAlignment.Top);

                EditorGUI.LabelField(labelRect, Creature.Species.Name);
                _instructionCaller.Draw(speciesRect, GUIContent.none);

                if (GUI.Button(editRect, _editSpeciesButton.Content, GUIStyle.none))
                {
                    Selection.activeObject = Creature.Species;
                }
            }

            if (Creature.Creature != null)
            {
                var editRect = RectHelper.TakeTrailingIcon(ref position);
                EditorGUI.LabelField(position, Creature.Creature.Name);

                if (GUI.Button(editRect, _editCreatureButton.Content, GUIStyle.none))
                {
                    Selection.activeObject = Creature.Creature;
                }
            }
        }