Hello,
I am currently working on a really complex system and want to keep it as user-friendly as possible.
One of the main problems is that I use several classes in one *.cs file because otherwise I could not access the variables as I want to.
I tried using Editor Scripts to handle it easier but all my attempts failed. I am sure there is a much more elegant way to handle my data with a custom inspector.
First of all I want you to understand what I am working on:
using UnityEngine;
using UnityEditor;
using System.Collections;
[System.Serializable]
public class RPG_Database : MonoBehaviour {
public Hero[] Heroes;
public Classes[] Classes;
public Skills[] Skills;
}
[System.Serializable]
public class Hero {
public string Name;
public GameObject Sprite;
public Texture Face;
// Connection with Class System (?)
public int Life;
public int Magic;
public int Experience;
public int Level;
public Character_Audio Sounds;
public Battle_Animation Animations;
}
[System.Serializable]
public class Battle_Animation {
public AnimationClip[] Animations;
public GameObject Effect;
public float WaitTime;
public bool isRanged;
}
[System.Serializable]
public class Character_Audio {
public AudioClip[] Attack;
public AudioClip[] Hit;
public AudioClip[] Jump;
public AudioClip[] Critical;
public AudioClip[] BattleStart;
public AudioClip[] BattleEnd;
public AudioClip[] Charge;
public AudioClip[] UseItem;
public AudioClip[] CannotUse;
public AudioClip[] JoinParty;
public AudioClip[] LevelGain;
public AudioClip[] Injured;
public AudioClip[] Die;
public AudioClip[] Loot;
}
[System.Serializable]
public class Classes {
public string Name;
}
[System.Serializable]
public class Skills {
public string Name;
public int Value;
public int Targets;
public GameObject Effect;
}
It is a global accessible Database which is used by other Systems like a Round Based Battle System for example. It is working as it should be but not very user-friendly as the following screenshot should explain:

Another problem is that I want be able to interact between each class.
For example I want that the Hero Class can access the Class Variable of the RPG_Database Script so that everything is dynamically connected.
This is the first time that I need help with my Unity Project.
Sadly the documentation about Editor-Scripting with C# is very poor.
I hope anyone can help me. I am looking forward to get rid of these problems as soon as possible. ![]()