Example #1
0
        private void DrawActor(RPGDatabaseManager database)
        {
            var entry = (ActorData)entrySelected;

            var classNames = database.FetchEntry <ActorClassDataList>().entries.Select(l => l.name).ToArray();
            var classIds   = database.FetchEntry <ActorClassDataList>().entries.Select(l => l.Id).ToArray();

            var actorClass = database.FetchEntry <ActorClassDataList>().entries.FirstOrDefault(l => l.Id == entry.classId);

            if (actorClass == null)
            {
                actorClass = new ActorClassData(entry.classId);
            }

            var weaponNames = database.FetchEntry <WeaponDataList>().entries.Where(l => l.typeId == actorClass.weaponTypeId).Select(l => l.name).ToArray();
            var weaponIds   = database.FetchEntry <WeaponDataList>().entries.Where(l => l.typeId == actorClass.weaponTypeId).Select(l => l.Id).ToArray();

            var attrList = database.FetchEntry <AttributeSpecDataList>();
            var level    = attrList.entries.First(x => x.name == Constants.Attributes.LEVEL);

            EditorGUILayout.BeginVertical("GroupBox", GUILayout.Width(400));
            DrawTitle();

            entry.name         = EditorGUILayout.TextField("Name", entry.name);
            entry.classId      = EditorGUILayout.IntPopup("Class", entry.classId, classNames, classIds);
            entry.initialLevel = EditorGUILayout.IntSlider("Initial Level", entry.initialLevel, level.start, level.end);

            EditorGUILayout.BeginVertical("GroupBox", GUILayout.Width(350));
            BrightEditorGUILayout.LabelFieldBold("Graphics");
            entry.graphics.face = SpriteField("Face", entry.graphics.face);
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginVertical("GroupBox", GUILayout.Width(350));
            BrightEditorGUILayout.LabelFieldBold("Initial Equipment");
            entry.initialWeapon = EditorGUILayout.IntPopup("Weapon", entry.initialWeapon, weaponNames, weaponIds);
            EditorGUILayout.EndVertical();

            EditorGUILayout.EndVertical();
        }
Example #2
0
 public Actor(ActorData data, ActorClassData classData)
 {
     _actorData = data;
     _classData = classData;
     _level     = _actorData.initialLevel;
 }