PropertySpace特性:與Unity的現(xiàn)有Space屬性具有相同的功能呜笑,但可以應(yīng)用于任何屬性而不僅僅是字段
而且還可以控制與前后字段的間距
完整示例代碼
using Sirenix.OdinInspector;
using UnityEngine;
public class PropertySpaceExample : MonoBehaviour
{
[Space]
public int unitySpace;
[Space(5)]
public int unitySpace1;
[PropertySpace]
public int OdinSpace2;
[ShowInInspector, PropertySpace]
public int Property { get; set; }
// 還可以控制PropertySpace屬性前后的間距胆描。
[PropertySpace(SpaceBefore = 30, SpaceAfter = 30)]
public int BeforeAndAfter;
[PropertySpace(SpaceBefore = 30, SpaceAfter = 30)]
public int BeforeAndAfter1;
}