I’m trying to make a custom inspector to an dialogue system just to hide some things I isn’t using to that dialogue in specific. For that dialogue system i have a custom class to store sentences and things related to visual expressions, and itens to give at the final of the sentence. Property fields seems to work to the dialog system asset, but not to the sentences data script. Even making an editor script for that sentence data storage didn’t work.
Property drawer could fix this issue, but it’s a little more complex for a more simple thing I what to do. Is there a way to make custom classes in arrays to work better with custom editors better? I will leave an image as an example of what i’m saying
Thanks for reading so Far
I’m having trouble understanding what your problem is. Are you just trying to hide certain fields? [HideInInspector] exists for that. Or do you only want fields not to show up in certain situations?
1 Like
Basicaly some fields not showing up in some situations. It seems to work properly with contents inside of the Scriptable object, Except the custom class inside of the object.
public class DialogueSO : ScriptableObject
{
[TextArea(1, 1)]
public string ID;
[TextArea(2, 3)]
public string XMLDescription;
//public TextData data;
public bool isCompositeText = false;
public List<Data> DialogoEmOrdem = new List<Data>(1);
[Header("Proxima fala a ser reproduzida")]
[Tooltip("Caso essa caixa esteja vazia, ela apenas fará algo que já está scriptado")]
public DialogueSO proximaFala;
public bool HasOptions;
[Header("Opções a escolher")]
public DialogueSO Options;
}
[System.Serializable]
public class Data
{
public Expression Expressao;
[TextArea(5, 5)]
public string Sentence;
public Vector2 DialogBubbleOffset;
public bool GiveItem = false;
public ConsumableItemSO ConsumableItem;
public EquipmentItemSO EquipmentItem;
public KeyItemSO KeyItem;
}
This is the code of the Scriptable Object and the data script for clarification.
I tried make one editorScript to each class but it didn’t work. Do you think that they being in the same cs file have a relation to the problem?
Not sure but it’s good practice to keep them all in separate files, as issues can arise by putting multiple classes in the same file.
1 Like
Since this class is just used to store some datas like strings and some asset references, and there are no extensions or intefaces in the data class I didn’t see a problem putting the class in the same file. But even when i separated them, the override issue wasn’t solved, so I kept them as it was.
If you have an idea of how to solve it I’ll be happy to hear, for now I’ll try some other thing while I can for today