I have a small Unity plugin project set up (working on fixing a broken mod), and the Camera class seems to be missing a method. I've added Unity dll assembly references, and everything is working except this ONE method. (I went by the advice of a tutorial which did this, so maybe there's a more correct way?)
It's about a 600 line file with lots of references to Unity stuff that are working fine, including other Camera references. In fact if I comment this bit out, the plugin builds and works fine.
This is what I'm importing:
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using UnityEngine;
using UnityEngine.Rendering;
When I inspect the Assembly (decompiled by Rider), this Camera.ScreenToWorldPoint method really is missing (see left view).
pos = mainCamera.ScreenToWorldPoint(new Vector3((float) ((double) mainCamera.pixelWidth * 0.5 - 50.0), (float) mainCamera.pixelHeight * 0.1f, 1f));
What else can I try or investigate to get to the bottom of this?
(I know this line of code looks like it does nothing, but I believe it actually IS doing something, because this is a Harmony "Prefix". It looks like it's modifying the value of the "pos" parameter passed into the method that Harmony is patching.)