c# - Unity - 如果我使用自己的 Start() 方法创建两个脚本,哪一个将首先调用?

标签 c# unity-game-engine lifecycle

我创建了两个简单的脚本(ScriptA 和 ScriptB)。两者都包含 Start() 方法。 我发现后者总是先开始。这是Unity正常的做法吗?

最佳答案

来自Unity Documentation :

By default, the Awake, OnEnable and Update functions of different scripts are called in the order the scripts are loaded (which is arbitrary). However, it is possible to modify this order using the Script Execution Order settings (menu: Edit > Project Settings > Script Execution Order).

关于c# - Unity - 如果我使用自己的 Start() 方法创建两个脚本,哪一个将首先调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41719884/

相关文章:

mysql - 如何将我的 Unity3D 应用程序连接到 Mac OSX 上的 MySQL 数据库

unity-game-engine - OnCollisionStay 与 OnCollisionEnter

android - 如何控制 Fragment 和 FragmentPagerAdapter 的生命周期

javascript - 有没有办法在 Vue.js 中动态插入点击事件?

c# - 在 LinQ Lambda 表达式中连接两个列值

c# - 使用 C# 构建的 Gitlab CI

c# - Windows .NET/Win32 UI开发

c# - 通过unity从服务器获取数据

android - 在 fragment 第一次可见后立即执行代码

c# - 在 FluentValidation 中为规则集设置消息失败