TylerTemp / SaintsField

A Unity Inspector extension tool focusing on script fields inspector enhancement
MIT License
148 stars 9 forks source link

[Button] Appears to not be working #30

Closed Gizzmicbob closed 3 months ago

Gizzmicbob commented 3 months ago

I may be misunderstanding how it's used, but it appears to not work no matter what I do

[Button]
private void AddEntry()
{
    MovePositionEntryStruct movePositionEntry = new();
    movePositionEntry.MovePosition = Vector3.zero;
    movePositionEntry.SpeedType = MoveSpeedType.MetersPerSecond;
    movePositionEntry.Speed = 1;
    movePositionEntry.SpeedCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);
    movePositions.Add(movePositionEntry);
}

This worked with NaughtyAttributes, would I go about it differently with SaintsField? I have tried adding a label, making the method public, etc.

TylerTemp commented 3 months ago

Hi,

NaughtyAttributes by default override the default drawer to NaughtyInspector. To avoid conflict, SaintsField does not by default do it.

So ensure you have SaintsEditor enabled first. The most simple way is to use Window - Saints - Apply SaintsEditor.

Please note, this component does not work with NaughtyAttributes or Odin: only one UnityEditor.Editor can work on one object.

Gizzmicbob commented 3 months ago

That sorted it, thanks.