Esempio n. 1
0
        private void DrawTrainer(Trainer trainer)
        {
            if (trainer && trainer.Roster != null && trainer.Roster.Creatures != null)
            {
                EditorGUILayout.LabelField("Roster");

                var rosterRect = EditorGUILayout.GetControlRect(false, RectHelper.LineHeight * trainer.Roster.Creatures.Count);
                RectHelper.TakeIndent(ref rosterRect);

                foreach (var creature in trainer.Roster.Creatures)
                {
                    var rect = RectHelper.TakeLine(ref rosterRect);
                    var icon = RectHelper.TakeLeadingIcon(ref rect);

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

                    GUI.Label(rect, creature.Name);
                }
            }
        }