简体   繁体   English

在 Unity Timeline 中修改对象公共变量

[英]Modify Object Public Variables in Unity Timeline

I have a script to control unique properties of a given character.我有一个脚本来控制给定角色的独特属性。

Im looking for ways to be able to change public variables of this given script inside a timeline, or simply remove/deactivate a gameobject.我正在寻找能够在时间轴内更改此给定脚本的公共变量的方法,或者只是删除/停用游戏对象。

Ideally, something more "generic" would be running some piece of code inside the timeline, having some arguments that could be inputed by configuring the timeline.理想情况下,更“通用”的东西会在时间线内运行一些代码,有一些可以通过配置时间线输入的参数。 Could i do things like call methods of scripts in timelines ?我可以做一些事情,比如在时间线中调用脚本的方法吗?

Is this something doable ?这是可行的吗? I do not want to create animations for every timeline transition.我不想为每个时间线过渡创建动画。

Would appreciate any help !将不胜感激任何帮助!

正如上面的评论所指出的,时间线信号解决了这个问题,作为一种通知外部代码已经到达特定时间线点的方式。

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

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