Basically, this code right here:
using BepInEx;
using BepInEx.Unity.IL2CPP;
using UnityEngine;
using UnityEngine.UI;
using System.Linq;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
namespace PleaseWorkIBegYou
{
[BepInPlugin("org.bepinex.plugins.giftscoprecreation", "PleaseWorkIBegYou", "1.0.0.0")]
[BepInProcess("Petscop.exe")]
public class Plugin : BasePlugin
{
public Shader lo = Shader.Find("Hidden/BlitCopy");
public Shader lo2 = Shader.Find("Custom/Main");
public override void Load()
{
// Plugin startup logic
Log.LogInfo($"Plugin PleaseWorkIBegYou is loaded!");
// Your code starts here
foreach (BlitRenderTexture m in Resources.FindObjectsOfTypeAll(Il2CppType.Of<BlitRenderTexture>()).Cast<Il2CppReferenceArray<BlitRenderTexture>>())
{
if (m.shader == lo2)
{
m.shader = lo;
}
}
// Your code ends here
}
}
}
should work correctly, but it gives me CS0103 error in IL2Cpp type.
How exactly can I fix this?
Asking ChatGPT, which gave me slightly different version of this code, that still doesn't work.