项目中大量用到了PlayableBehaviour,而PlayableBehaviour中的参数是由PlayableAsset传递进去的,因为参数比较复杂同时需要一些控制选项所以定制了Inspector中的显示。

方法其实和一般定制其他类的方法相同。

 

using UnityEngine;
using UnityEditor;

public class A : PlayableAsset
{
}

[CustomEditor(typeof(A))]
public class Test : Editor
{
        A m_Target;
    
       void OnEnable()
       {
              m_Target = (A)target;
        }        

       public override void OnInspector()
       {
    
            // EditorGUILayout.FloatLable();
       }
}             

 

相关文章:

  • 2022-12-23
  • 2021-07-03
  • 2021-07-29
  • 2021-06-22
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
猜你喜欢
  • 2022-12-23
  • 2021-09-02
  • 2021-05-06
  • 2022-12-23
  • 2022-12-23
  • 2022-03-10
相关资源
相似解决方案