英文:
How to drive rect transform on Unity
问题
I'm making a script editing the some values of RectTransform and I want write "Some values driven by Script" to RectTransform in Editor.
我正在编写一个脚本,用于编辑RectTransform的一些值,我想在编辑器中将"Some values driven by Script"写入RectTransform。
I'm making a script editing the some values of RectTransform.
我正在编写一个脚本,用于编辑RectTransform的一些值。
I want to do this

我想要实现这个

I do this

我做了这个

How can I add "Some Values Driven By **" text?
如何添加"由**驱动的一些值"文本?
英文:
I'm making a script editing the some values of RectTransform and I want write "Some values driven by Script" to RectTransform in Editor.
I'm making a script editing the some values of RectTransform.
I want to do this

I do this

How can I add "Some Values Driven By **" text?
答案1
得分: 1
RectTransform 在向名为 DrivenRectTransformTracker 的结构添加元素时似乎会被禁用,该结构在 RectTransform 脚本实现中定义。
您所描述的情况是在 GridLayoutGroup 实现中完成的,它是类 GridLayoutGroup 继承的类 LayoutGroup 的受保护成员。
您可以在 Unity 脚本参考文档 中找到有关它的文档。
英文:
RectTransforms seem to disable when you add elements to a struct called DrivenRectTransformTracker defined in the RectTransform scripting implementation.
The case that you describe is done in the GridLayoutGroup implementation which is a protected member of the class the GridLayoutGroup inherits from, LayoutGroup.
The documentation for it can be found in the Unity Scripting Reference.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。


评论