public UpdateMethod UpdateDelegate = () => { }; //Delegate method to run in update. Replace with the method that should run as update //Initializes the required members of the object public virtual void Init(Copter copter) { GiveName(); playerRb = copter.GetComponent <Rigidbody2D>(); //Get the reference to players rigidbody playerCopter = copter; playerCopter.AddToDictionary(this); //Add the new Upgrade to the copters upgrade list upgrade.Init(playerCopter.copterName + name); }
public static bool Prefix(Copter __instance, ref Rigidbody ___r) { ___r = __instance.GetComponent <Rigidbody>(); MethodInfo methodInfo = typeof(Copter).GetMethod("Move", BindingFlags.NonPublic | BindingFlags.Instance); __instance.StartCoroutine((IEnumerator)methodInfo.Invoke(__instance, new object[0])); return(false); }