【问题标题】:Unity - Show Different attributes for different values of another variables in inspectorUnity - 在检查器中显示另一个变量的不同值的不同属性
【发布时间】:2018-01-22 18:26:28
【问题描述】:

我想要这样的东西:

我有一个附加到游戏对象的脚本。该脚本有如下内容,例如:

enum Type {type1, type2};

public Type temptype;

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

在检查器中,当我为“temptype”变量选择“type1”时,我想显示 F1、F2 和 F3,但隐藏 F4 和 F5。选择“type2”时,F1、F2、F3隐藏,F4、F5可见。

这就像画布组件的“渲染模式”选项。当我们选择“屏幕空间 - 覆盖”时,一些变量会显示在下面,当我们选择“世界”时,会出现一些不同的变量。

我不想使用自定义检查器技术。也许是抽屉或属性属性。

【问题讨论】:

标签: c# unity3d unity5


【解决方案1】:

我认为没有 customEditors 是不可能的:/

【讨论】:

    猜你喜欢
    • 2019-08-05
    • 2016-12-12
    • 2021-02-17
    • 1970-01-01
    • 2017-11-19
    • 1970-01-01
    • 2021-12-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多