# SetProperty **Repository Path**: Qiuym/SetProperty ## Basic Information - **Project Name**: SetProperty - **Description**: Unity的插件:Unity允许使用[SerializeField]序列化私有字段。每次在Unity的inspector中修改字段时,使用新的[SetProperty]属性设置公共属性。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-12-08 - **Last Updated**: 2021-12-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README SetProperty =========== A PropertyAttribute/PropertyDrawer combination that allows for properties in Unity Example ------- Unity allows you to serialize private fields with [SerializeField]. Use the new [SetProperty] attribute to have a public property set every time the field is modified in Unity's inspector. NOTE: It is okay to have private setters for public properties. Vanilla classes (i.e. non-MonoBehaviours) also work as well. [SerializeField, SetProperty("Number")] private float number; public float Number { get { return number; } private set { number = Mathf.Clamp01(value); } }