简体   繁体   English

Unity-在检查器中显示其他变量的不同值的不同属性

[英]Unity - Show Different attributes for different values of another variables in inspector

I want to have something like this: 我想要这样的东西:

I have a script attached to a game object. 我有一个附加到游戏对象的脚本。 the script has something like below, for example: 该脚本具有以下内容,例如:

enum Type {type1, type2};

public Type temptype;

public float F1;
public float F2;
public float F3;
public float F4;
public float F5;

in the inspector, when I select "type1" for "temptype" variable, I want to F1, F2 and F3 appear but F4 and F5 be hidden. 在检查器中,当我为“ temptype”变量选择“ type1”时,我希望F1,F2和F3出现,但F4和F5隐藏。 and when "type2" is selected, F1, F2, F3 hides and F4 and F5 be visible. 当选择“ type2”时,F1,F2,F3隐藏,并且F4和F5可见。

this is like "Render Mode" option of canvas component. 这就像画布组件的“渲染模式”选项。 when we select "screen space - overlay", some variables show in below and when we select "world" some different variables appear. 当我们选择“屏幕空间-覆盖”时,下面显示一些变量,而当我们选择“世界”时,则会出现一些不同的变量。

I don't want to use custom inspector technics. 我不想使用自定义检查器技术。 Maybe drawers or property attributes. 也许是抽屉或属性。

我认为没有customEditors不可能实现:/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM