修改脚本后调试有时候需要运行,为了提高效率可以设置编辑器中执行,同时也可以开启有效性检查(即更改面板变量即可刷新代码)

[ExecuteInEditMode]
public class XXXX: MonoBehaviour
{

    #if UNITY_EDITOR
    void OnValidate()
    {
        Refresh();
    }

    void Reset()
    {
        Refresh();
    }
    #endif

}

 

相关文章:

  • 2021-11-22
  • 2021-11-21
  • 2022-12-23
  • 2021-09-16
  • 2021-05-18
  • 2022-12-23
猜你喜欢
  • 2021-10-25
  • 2022-12-23
  • 2021-08-05
  • 2021-05-25
  • 2022-12-23
  • 2021-10-14
  • 2021-11-21
相关资源
相似解决方案