Programmatically define execution order of scripts
问题 By programmatically adding scripts to a given game object, will these scripts execute in the order they were added? Will their events run in the order they were added? void Awake () { gameObject.AddComponent("Script_1"); gameObject.AddComponent("Script_2"); } 回答1: Short answer: No. But you can set Script Execution Order in the settings (menu: Edit > Project Settings > Script Execution Order) or change it from code: // First you get the MonoScript of your MonoBehaviour MonoScript monoScript =