This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEditor; | |
using UnityEngine; | |
using UnityEditorInternal; | |
using System.Linq; | |
using Version = System.Version; | |
using UnityEditor.Callbacks; | |
public class VersionUpdate | |
{ | |
private const string PLAYER_SETTINGS_ASSEMBLY_NAME = "UnityEditor.PlayerSettings"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Injector | |
{ | |
[MenuItem("Hacks/Inject Build Callback")] | |
public static void BuildCallback() | |
{ | |
Assembly.BeginEditingAssembly(AssemblyTypes.UnityEditor, editAlreadyModifed:true); | |
{ | |
TypeDefinition buildPiplelineType = Assembly.GetType<BuildPipeline>(); | |
MethodDefinition buildInternalMethod = buildPiplelineType.GetMethod("BuildPlayerInternal"); |
NewerOlder