Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of DrawableWhiteboard v0.1.0
BepInEx/plugins/DrawableWhiteboard.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Dawn; using DrawableWhiteboard.Behaviours; using DrawableWhiteboard.NetcodePatcher; using GameNetcodeStuff; using HarmonyLib; using HatLib.Tools; using Microsoft.CodeAnalysis; using TMPro; using Unity.Netcode; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering.HighDefinition; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DrawableWhiteboard")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0")] [assembly: AssemblyProduct("DrawableWhiteboard")] [assembly: AssemblyTitle("DrawableWhiteboard")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [module: NetcodePatchedAssembly] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DrawableWhiteboard { internal enum WhiteboardPointBudget { Points2K = 2048, Points4K = 4096, Points8K = 8192, Points16K = 16384, Points32K = 32768, Points48K = 49152 } internal static class ConfigManager { private const string DuskGUID = "MrHat.DrawableWhiteboard"; private static readonly DuskConfigInjector Dusk = new DuskConfigInjector("MrHat.DrawableWhiteboard"); internal static ConfigEntry<bool> DebugLogsEnabled { get; private set; } = null; internal static ConfigEntry<WhiteboardPointBudget> PointBudget { get; private set; } = null; internal static ConfigEntry<string> StartingColour { get; private set; } = null; internal static ConfigEntry<float> StartingBrushSize { get; private set; } = null; internal static ConfigEntry<bool> SimpleToolCursors { get; private set; } = null; internal static void Bind() { PointBudget = Dusk.Bind<WhiteboardPointBudget>("Drawable Whiteboard Options", "Point Budget", WhiteboardPointBudget.Points8K, "The maximum number of 'points' the whiteboard remembers. Higher values allow more drawing, but use more network data and save space. README has more info"); StartingColour = Dusk.Bind<string>("Drawable Whiteboard Options", "Starting Colour", "000000", "The colour selected whenever you start using the whiteboard for the first time"); StartingBrushSize = Dusk.Bind<float>("Drawable Whiteboard Options", "Starting Brush Size", 3f, "The brush size selected whenever you start using the whiteboard for the first time", 1f, 20f); SimpleToolCursors = Dusk.Bind<bool>("Drawable Whiteboard Options", "Simple Tool Cursors", false, "Replaces the brush and eraser cursor artwork with a simple dot"); DebugLogsEnabled = Dusk.Bind<bool>("Internal", "Enable Debug Logging", false, "Enables debug logging."); } } internal static class Log { internal static void Debug(string message) { if (ConfigManager.DebugLogsEnabled.Value) { Write((LogLevel)32, message); } } internal static void Info(string message) { Write((LogLevel)16, message); } internal static void Warn(string message) { Write((LogLevel)4, message); } internal static void Error(string message) { Write((LogLevel)2, message); } internal static void Fatal(string message) { Write((LogLevel)1, message); } private static void Write(LogLevel logLevel, string message) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) Plugin.mls.Log(logLevel, (object)message); } } internal static class Patches { [HarmonyPatch(typeof(PlayerControllerB), "Interact_performed")] [HarmonyPatch(typeof(PlayerControllerB), "ItemSecondaryUse_performed")] [HarmonyPatch(typeof(PlayerControllerB), "ItemTertiaryUse_performed")] [HarmonyPatch(typeof(PlayerControllerB), "QEItemInteract_performed")] [HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_performed")] [HarmonyPatch(typeof(PlayerControllerB), "ActivateItem_canceled")] [HarmonyPatch(typeof(PlayerControllerB), "Discard_performed")] [HarmonyPatch(typeof(PlayerControllerB), "ScrollMouse_performed")] [HarmonyPatch(typeof(PlayerControllerB), "UseUtilitySlot_performed")] [HarmonyPatch(typeof(PlayerControllerB), "InspectItem_performed")] [HarmonyPatch(typeof(PlayerControllerB), "OpenMenu_performed")] [HarmonyPatch(typeof(PlayerControllerB), "Jump_performed")] [HarmonyPatch(typeof(PlayerControllerB), "Crouch_performed")] [HarmonyPatch(typeof(PlayerControllerB), "Emote1_performed")] [HarmonyPatch(typeof(PlayerControllerB), "Emote2_performed")] [HarmonyPatch(typeof(PlayerControllerB), "SetFreeCamera_performed")] [HarmonyPatch(typeof(PlayerControllerB), "SpeedCheat_performed")] [HarmonyPatch(typeof(HUDManager), "SubmitChat_performed")] [HarmonyPatch(typeof(HUDManager), "EnableChat_performed")] [HarmonyPatch(typeof(HUDManager), "OpenMenu_performed")] [HarmonyPatch(typeof(HUDManager), "PingScan_performed")] [HarmonyPatch(typeof(QuickMenuManager), "OpenQuickMenu")] [HarmonyPatch(typeof(ShipBuildModeManager), "EnterBuildMode")] [HarmonyPrefix] private static bool BlockInputMegaPrefix() { return !DrawableWhiteboard.Behaviours.DrawableWhiteboard.IsOpen; } [HarmonyPatch(typeof(PlayerControllerB), "TeleportPlayer")] [HarmonyPrefix] private static void TeleportPlayerPrefix(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)DrawableWhiteboard.Behaviours.DrawableWhiteboard.Instance != (Object)null) { DrawableWhiteboard.Behaviours.DrawableWhiteboard.Instance.StopUsingBoard(releaseBoard: true); } } [HarmonyPatch(typeof(GameNetworkManager), "ResetSavedGameValues")] [HarmonyPrefix] private static void ResetSavedGameValuesPrefix() { if ((Object)(object)DrawableWhiteboard.Behaviours.DrawableWhiteboard.Instance != (Object)null) { DrawableWhiteboard.Behaviours.DrawableWhiteboard.Instance.WriteBoardSave(); } } [HarmonyPatch(typeof(PlayerControllerB), "SetHoverTipAndCurrentInteractTrigger")] [HarmonyPostfix] private static void SetHoverTipAndCurrentInteractTriggerPrefix(PlayerControllerB __instance) { if ((Object)(object)__instance == (Object)(object)GameNetworkManager.Instance.localPlayerController && (Object)(object)DrawableWhiteboard.Behaviours.DrawableWhiteboard.Instance != (Object)null && (Object)(object)__instance.hoveringOverTrigger == (Object)(object)DrawableWhiteboard.Behaviours.DrawableWhiteboard.Instance.InteractTrigger && (__instance.isHoldingObject || (Object)(object)__instance.currentlyHeldObjectServer != (Object)null || __instance.twoHanded)) { ((TMP_Text)__instance.cursorTip).text = "[Hands full]"; } } } [BepInPlugin("MrHat.DrawableWhiteboard.Internals", "DrawableWhiteboard", "0.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string modGUID = "MrHat.DrawableWhiteboard.Internals"; public const string modName = "DrawableWhiteboard"; public const string modVersion = "0.1.0"; private readonly Harmony _harmony = new Harmony("MrHat.DrawableWhiteboard.Internals"); internal static ManualLogSource mls; private void Awake() { mls = ((BaseUnityPlugin)this).Logger; InitialiseNetworkSerialisation(); ConfigManager.Bind(); _harmony.PatchAll(typeof(Patches)); Log.Info("DrawableWhiteboard loaded"); } private static void InitialiseNetworkSerialisation() { MethodInfo method = typeof(Plugin).Assembly.GetType("__GEN.NetworkVariableSerializationHelper").GetMethod("InitializeSerialization", BindingFlags.Static | BindingFlags.NonPublic); if (method == null) { Log.Fatal("Netcode serialization method was not found"); } else { method.Invoke(null, null); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "DrawableWhiteboard"; public const string PLUGIN_NAME = "DrawableWhiteboard"; public const string PLUGIN_VERSION = "0.1.0"; } } namespace DrawableWhiteboard.Behaviours { public class DrawableWhiteboard : NetworkBehaviour { private const float PointRate = 30f; private const float MinimumPointPixels = 3f; private const float MinimumRadiusStep = 0.1f; private const float RayDistance = 10f; private const int LegacyToolSaveSize = 5; private const int ToolSaveSize = 6; private const ulong NoDrawer = ulong.MaxValue; private static readonly NamespacedKey SaveKey = NamespacedKey.From("drawablewhiteboard", "drawable_whiteboard"); private static readonly NamespacedKey ToolSaveKey = NamespacedKey.From("drawablewhiteboard", "drawable_whiteboard_tools"); [Header("Whiteboard")] [SerializeField] private InteractTrigger interactTrigger; [SerializeField] private Transform cameraPosition; [SerializeField] private BoxCollider drawingCollider; [SerializeField] private DecalProjector drawingDecal; [SerializeField] private Material brushMaterial; [SerializeField] private WhiteboardHUDSettings HUDSettings; [Header("Drawing")] [SerializeField] private int textureWidth = 1024; [SerializeField] private int textureHeight = 512; [Header("Audio")] [SerializeField] private AudioSource markerAudioSource; private NetworkVariable<ulong> drawerClientId; private NetworkVariable<uint> rememberedColour; private NetworkVariable<byte> rememberedBrushRadius; private NetworkVariable<byte> rememberedEraserRadius; private NetworkVariable<byte> rememberedRadiusStep; private NetworkList<WhiteboardPoint> points; private List<int> undoStarts; private AudioSource whiteboardAudio; private BoxCollider interactCollider; private InputAction exitAction; private RaycastHit[] drawingHits; private WhiteboardDrawingSurface drawingSurface; private WhiteboardPlayerSession? playerSession; private WhiteboardPoint lastMousePoint; private Color selectedBrushColour; private int pointBudget; private float selectedBrushRadius; private float selectedEraserRadius; private float selectedRadiusStep; private bool prefabReady; private bool newStroke = true; private bool newAction; private bool hasMousePoint; private bool saveDirty; private bool pointLimitLogged; private bool eraserSelected; private bool colourPickerSelected; private bool awaitingPickerRelease; private bool autoSaveRegistered; private float nextPointTime; internal static DrawableWhiteboard? Instance; internal static bool IsOpen { get { if ((Object)(object)Instance != (Object)null) { return Instance.playerSession != null; } return false; } } internal InteractTrigger InteractTrigger => interactTrigger; internal Color SelectedBrushColour => selectedBrushColour; internal float SelectedToolRadius { get { if (!eraserSelected) { return selectedBrushRadius; } return selectedEraserRadius; } } internal float SelectedRadiusStep => selectedRadiusStep; internal bool EraserSelected => eraserSelected; internal bool ColourPickerSelected => colourPickerSelected; private void Awake() { //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) WhiteboardPointBudget value = ConfigManager.PointBudget.Value; drawerClientId = new NetworkVariable<ulong>(ulong.MaxValue, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); pointBudget = (int)value; points = new NetworkList<WhiteboardPoint>(); undoStarts = new List<int>(); interactCollider = ((Component)interactTrigger).GetComponent<BoxCollider>(); PlaceableShipObject componentInChildren = ((Component)((Component)this).transform.parent).GetComponentInChildren<PlaceableShipObject>(true); whiteboardAudio = ((Component)componentInChildren).GetComponent<AudioSource>(); drawingHits = (RaycastHit[])(object)new RaycastHit[8]; string text = ConfigManager.StartingColour.Value.Trim().TrimStart('#'); Color val = default(Color); bool flag = text.Length != 6 || !ColorUtility.TryParseHtmlString("#" + text, ref val); bool flag2 = flag; if (!flag2) { bool flag3; switch (value) { case WhiteboardPointBudget.Points2K: case WhiteboardPointBudget.Points4K: case WhiteboardPointBudget.Points8K: case WhiteboardPointBudget.Points16K: case WhiteboardPointBudget.Points32K: case WhiteboardPointBudget.Points48K: flag3 = true; break; default: flag3 = false; break; } flag2 = !flag3; } if (flag2 || ConfigManager.StartingBrushSize.Value < HUDSettings.MinimumBrushRadius || ConfigManager.StartingBrushSize.Value > HUDSettings.MaximumBrushRadius || HUDSettings.BrushRadiusStep < 0.1f || HUDSettings.BrushRadiusStep > HUDSettings.MaximumBrushRadius) { Log.Error("Whiteboard config settings are invalid"); ((Behaviour)this).enabled = false; return; } exitAction = InputSystem.actions.FindAction("OpenMenu", true); Color32 val2 = Color32.op_Implicit(val); byte b = (byte)Mathf.RoundToInt(ConfigManager.StartingBrushSize.Value * 10f); byte b2 = (byte)Mathf.RoundToInt(HUDSettings.BrushRadiusStep * 10f); uint num = (uint)((val2.r << 16) | (val2.g << 8) | val2.b); rememberedColour = new NetworkVariable<uint>(num, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); rememberedBrushRadius = new NetworkVariable<byte>(b, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); rememberedEraserRadius = new NetworkVariable<byte>(b, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); rememberedRadiusStep = new NetworkVariable<byte>(b2, (NetworkVariableReadPermission)0, (NetworkVariableWritePermission)0); selectedBrushColour = val; selectedBrushRadius = ConfigManager.StartingBrushSize.Value; selectedEraserRadius = ConfigManager.StartingBrushSize.Value; selectedRadiusStep = HUDSettings.BrushRadiusStep; drawingSurface = new WhiteboardDrawingSurface(drawingDecal, brushMaterial, textureWidth, textureHeight); if (!drawingSurface.Configure()) { ((Behaviour)this).enabled = false; return; } ((UnityEvent<PlayerControllerB>)(object)interactTrigger.onInteract).AddListener((UnityAction<PlayerControllerB>)UseWhiteboard); DawnSaveEvents.OnCollectData += WriteBoardSave; autoSaveRegistered = true; Instance = this; DawnFindResource.OnFreeze<DawnUnlockableItemInfo>((Registry<DawnUnlockableItemInfo>)(object)LethalContent.Unlockables, (Action)AssignLoadedAssets); prefabReady = true; } public override void OnNetworkSpawn() { ((NetworkBehaviour)this).OnNetworkSpawn(); if (prefabReady) { NetworkVariable<ulong> obj = drawerClientId; obj.OnValueChanged = (OnValueChangedDelegate<ulong>)(object)Delegate.Combine((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<ulong>(DrawerChanged)); if (((NetworkBehaviour)this).IsServer) { ReadBoardSave(); ((NetworkBehaviour)this).NetworkManager.OnClientDisconnectCallback += PlayerLeft; } ((Collider)interactCollider).enabled = drawerClientId.Value == ulong.MaxValue; drawingSurface.Restart(points); if (drawerClientId.Value == ((NetworkBehaviour)this).NetworkManager.LocalClientId) { StartUsingBoard(); } } } private void AssignLoadedAssets() { GameObject val = default(GameObject); if (!DawnFindResource.Resolve<DawnUnlockableItemInfo, GameObject>((Registry<DawnUnlockableItemInfo>)(object)LethalContent.Unlockables, NamespacedKey<DawnUnlockableItemInfo>.Vanilla("shower"), (Func<DawnUnlockableItemInfo, GameObject>)((DawnUnlockableItemInfo info) => info.UnlockableItem.prefabObject), "Shower prefab", ref val)) { Log.Error("Whiteboard could not find the vanilla shower prefab"); ((Behaviour)this).enabled = false; return; } InteractTrigger componentInChildren = val.GetComponentInChildren<InteractTrigger>(true); PlaceableShipObject componentInChildren2 = val.GetComponentInChildren<PlaceableShipObject>(true); AudioSource val2 = default(AudioSource); ((Component)componentInChildren2).TryGetComponent<AudioSource>(ref val2); interactTrigger.hoverIcon = componentInChildren.hoverIcon; whiteboardAudio.outputAudioMixerGroup = val2.outputAudioMixerGroup; markerAudioSource.outputAudioMixerGroup = val2.outputAudioMixerGroup; Log.Debug("Whiteboard assigned vanilla shower assets"); } public override void OnNetworkDespawn() { if (prefabReady) { NetworkVariable<ulong> obj = drawerClientId; obj.OnValueChanged = (OnValueChangedDelegate<ulong>)(object)Delegate.Remove((Delegate?)(object)obj.OnValueChanged, (Delegate?)(object)new OnValueChangedDelegate<ulong>(DrawerChanged)); if (((NetworkBehaviour)this).IsServer) { ((NetworkBehaviour)this).NetworkManager.OnClientDisconnectCallback -= PlayerLeft; } if (playerSession != null) { StopUsingBoard(); } ((Collider)interactCollider).enabled = true; } ((NetworkBehaviour)this).OnNetworkDespawn(); } public override void OnDestroy() { if (autoSaveRegistered) { DawnSaveEvents.OnCollectData -= WriteBoardSave; } if ((Object)(object)interactTrigger != (Object)null) { ((UnityEvent<PlayerControllerB>)(object)interactTrigger.onInteract).RemoveListener((UnityAction<PlayerControllerB>)UseWhiteboard); } if (playerSession != null) { StopUsingBoard(); } Instance = null; drawingSurface?.Release(); ((NetworkBehaviour)this).OnDestroy(); } public void UseWhiteboard(PlayerControllerB player) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (((NetworkBehaviour)this).IsSpawned && drawerClientId.Value == ulong.MaxValue && !((Object)(object)player == (Object)null) && !((Object)(object)player != (Object)(object)GameNetworkManager.Instance.localPlayerController) && !player.isPlayerDead) { RequestBoardRpc(); } } private void Update() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_042d: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_04a2: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) if (!prefabReady || !((NetworkBehaviour)this).IsSpawned) { return; } drawingSurface.DrawMissing(points); if (playerSession == null) { return; } PlayerControllerB player = playerSession.Player; if ((Object)(object)player == (Object)null || player.isPlayerDead || !player.isPlayerControlled || (Object)(object)player.inAnimationWithEnemy != (Object)null || exitAction.WasPressedThisFrame()) { StopUsingBoard(releaseBoard: true); return; } Keyboard current = Keyboard.current; Mouse current2 = Mouse.current; if (current2 == null) { EndStroke(); return; } Vector2 val = ((InputControl<Vector2>)(object)((Pointer)current2).position).ReadValue(); float y = ((InputControl<Vector2>)(object)current2.scroll).ReadValue().y; if (colourPickerSelected) { playerSession.PreviewPickerColour(selectedBrushColour); } if (awaitingPickerRelease) { if (!current2.leftButton.isPressed) { awaitingPickerRelease = false; } EndStroke(); return; } if (!colourPickerSelected && !playerSession.BlocksDrawing && !playerSession.HasPointer(val)) { if (!Mathf.Approximately(y, 0f)) { ChangeBrushRadius((y > 0f) ? 1 : (-1)); } if (current != null) { bool flag = ((ButtonControl)current.minusKey).wasPressedThisFrame || ((ButtonControl)current.numpadMinusKey).wasPressedThisFrame; bool flag2 = ((ButtonControl)current.equalsKey).wasPressedThisFrame || ((ButtonControl)current.numpadPlusKey).wasPressedThisFrame; int num = ((flag != flag2) ? ((!flag) ? 1 : (-1)) : 0); if (num != 0) { ChangeRadiusStep(num); } } } if (current != null && current.ctrlKey.isPressed && ((ButtonControl)current.zKey).wasPressedThisFrame && !playerSession.BlocksDrawing && !current2.leftButton.isPressed) { UndoWhiteboard(); } if (current2.leftButton.wasPressedThisFrame) { EndStroke(); newAction = true; } if (!colourPickerSelected && points.Count >= pointBudget) { EndStroke(); return; } if (playerSession.BlocksDrawing || playerSession.HasPointer(val)) { EndStroke(); return; } bool isPressed = current2.leftButton.isPressed; bool wasReleasedThisFrame = current2.leftButton.wasReleasedThisFrame; if (!colourPickerSelected && !isPressed && !wasReleasedThisFrame) { EndStroke(); return; } RectTransform rectTransform = ((Graphic)player.playerScreen).rectTransform; Canvas canvas = ((Graphic)player.playerScreen).canvas; Camera val2 = (((int)canvas.renderMode == 0) ? null : canvas.worldCamera); Vector2 val3 = default(Vector2); if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, val, val2, ref val3)) { EndStroke(); return; } Rect pixelAdjustedRect = ((Graphic)player.playerScreen).GetPixelAdjustedRect(); Rect uvRect = player.playerScreen.uvRect; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(((Rect)(ref uvRect)).x + Mathf.InverseLerp(((Rect)(ref pixelAdjustedRect)).xMin, ((Rect)(ref pixelAdjustedRect)).xMax, val3.x) * ((Rect)(ref uvRect)).width, ((Rect)(ref uvRect)).y + Mathf.InverseLerp(((Rect)(ref pixelAdjustedRect)).yMin, ((Rect)(ref pixelAdjustedRect)).yMax, val3.y) * ((Rect)(ref uvRect)).height); ((Component)player.gameplayCamera).transform.SetPositionAndRotation(cameraPosition.position, cameraPosition.rotation); Ray val5 = player.gameplayCamera.ViewportPointToRay(Vector2.op_Implicit(val4)); int num2 = Physics.RaycastNonAlloc(val5, drawingHits, 10f, 2048, (QueryTriggerInteraction)2); RaycastHit val6 = default(RaycastHit); bool flag3 = false; for (int i = 0; i < num2; i++) { if ((Object)(object)((RaycastHit)(ref drawingHits[i])).collider == (Object)(object)drawingCollider && ((Component)((RaycastHit)(ref drawingHits[i])).collider).CompareTag("DoNotSet")) { val6 = drawingHits[i]; flag3 = true; break; } } if (!flag3) { EndStroke(); return; } Vector3 val7 = ((Component)drawingCollider).transform.InverseTransformPoint(((RaycastHit)(ref val6)).point); float num3 = val7.x - drawingCollider.center.x; float num4 = val7.z - drawingCollider.center.z; float num5 = drawingCollider.size.x * 0.5f; float num6 = drawingCollider.size.z * 0.5f; if (Mathf.Abs(num3) > num5 || Mathf.Abs(num4) > num6) { EndStroke(); return; } float num7 = Mathf.InverseLerp(0f - num5, num5, num3); float num8 = Mathf.InverseLerp(0f - num6, num6, num4); if (colourPickerSelected) { if (drawingSurface.SampleColour(new Vector2(num7, num8), out var colour)) { playerSession.PreviewPickerColour(Color32.op_Implicit(colour)); if (current2.leftButton.wasPressedThisFrame) { ChooseBrushColour(Color32.op_Implicit(colour)); colourPickerSelected = false; awaitingPickerRelease = true; newAction = false; playerSession.RefreshToolVisuals(); } } EndStroke(); return; } SetMarkerAudio(isPressed && !eraserSelected); WhiteboardPoint point = new WhiteboardPoint((ushort)Mathf.RoundToInt(num7 * 65535f), (ushort)Mathf.RoundToInt(num8 * 65535f), (byte)(eraserSelected ? 2 : 0), (byte)Mathf.RoundToInt(selectedBrushColour.r * 255f), (byte)Mathf.RoundToInt(selectedBrushColour.g * 255f), (byte)Mathf.RoundToInt(selectedBrushColour.b * 255f), (byte)Mathf.RoundToInt(SelectedToolRadius * 10f)); float num9 = (float)(point.X - lastMousePoint.X) / 65535f * (float)drawingSurface.Width; float num10 = (float)(point.Y - lastMousePoint.Y) / 65535f * (float)drawingSurface.Height; float num11 = num9 * num9 + num10 * num10; bool flag4 = newStroke || !hasMousePoint; bool flag5 = isPressed && (flag4 || (Time.unscaledTime >= nextPointTime && num11 >= 9f)); if (wasReleasedThisFrame && hasMousePoint && num11 >= 1f) { flag5 = true; flag4 = false; } if (flag5) { WhiteboardPoint previousPoint = lastMousePoint; bool flag6 = hasMousePoint; if (flag4) { point.Flags |= 1; } if (!drawingSurface.DrawLocal(point, previousPoint, !flag4 && flag6)) { EndStroke(); return; } lastMousePoint = point; hasMousePoint = true; newStroke = false; nextPointTime = Time.unscaledTime + 1f / 30f; SendPointRpc(point, newAction); newAction = false; } if (wasReleasedThisFrame) { newAction = false; EndStroke(); } } private void LateUpdate() { playerSession?.KeepOpen(cameraPosition); } private void DrawerChanged(ulong _, ulong currentDrawer) { ((Collider)interactCollider).enabled = currentDrawer == ulong.MaxValue; if (currentDrawer == ((NetworkBehaviour)this).NetworkManager.LocalClientId) { StartUsingBoard(); } else if (playerSession != null) { StopUsingBoard(); } } private void StartUsingBoard() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) if (playerSession != null) { return; } PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController; if (!((Object)(object)localPlayerController == (Object)null) && !localPlayerController.isPlayerDead) { if (ShipBuildModeManager.Instance.InBuildMode) { ShipBuildModeManager.Instance.CancelBuildMode(true); Log.Debug("Build mode cancelled for whiteboard drawing"); } uint value = rememberedColour.Value; selectedBrushColour = Color32.op_Implicit(new Color32((byte)(value >> 16), (byte)(value >> 8), (byte)value, byte.MaxValue)); selectedBrushRadius = (float)(int)rememberedBrushRadius.Value / 10f; selectedEraserRadius = (float)(int)rememberedEraserRadius.Value / 10f; selectedRadiusStep = (float)(int)rememberedRadiusStep.Value / 10f; eraserSelected = false; colourPickerSelected = false; awaitingPickerRelease = false; EndStroke(); newAction = false; nextPointTime = 0f; playerSession = new WhiteboardPlayerSession(localPlayerController, cameraPosition, HUDSettings); } } internal void StopUsingBoard(bool releaseBoard = false) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (playerSession != null) { EndStroke(); playerSession.Close(); playerSession = null; newAction = false; if (releaseBoard && ((NetworkBehaviour)this).IsSpawned) { Color32 val = Color32.op_Implicit(selectedBrushColour); uint colourRgb = (uint)((val.r << 16) | (val.g << 8) | val.b); ReleaseBoardRpc(colourRgb, (byte)Mathf.RoundToInt(selectedBrushRadius * 10f), (byte)Mathf.RoundToInt(selectedEraserRadius * 10f), (byte)Mathf.RoundToInt(selectedRadiusStep * 10f)); } } } internal void ChooseBrushColour(Color colour) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) selectedBrushColour = new Color(colour.r, colour.g, colour.b, 1f); EndStroke(); } internal void ToggleDrawingTool() { EndStroke(); if (colourPickerSelected) { colourPickerSelected = false; eraserSelected = false; } else { eraserSelected = !eraserSelected; } playerSession?.ShowToolRadius(SelectedToolRadius); } internal void SelectColourPicker() { EndStroke(); eraserSelected = false; colourPickerSelected = true; } private void EndStroke() { SetMarkerAudio(drawing: false); newStroke = true; hasMousePoint = false; } private void SetMarkerAudio(bool drawing) { if (drawing) { if (!markerAudioSource.isPlaying) { markerAudioSource.timeSamples = Random.Range(0, markerAudioSource.clip.samples); markerAudioSource.Play(); } } else if (markerAudioSource.isPlaying) { markerAudioSource.Stop(); } } internal void UndoWhiteboard() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) EndStroke(); newAction = false; UndoRpc(); } internal void ClearWhiteboard() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) EndStroke(); ClearWhiteboardRpc(); } internal string? ExportWhiteboard() { string text = Path.Combine(Paths.PluginPath, "mr_hat-DrawableWhiteboard", "Exports"); string text2 = Path.Combine(text, $"Whiteboard_{DateTime.Now:yyyy-MM-dd_HH-mm-ss-fff}.png"); try { Directory.CreateDirectory(text); File.WriteAllBytes(text2, drawingSurface.ExportPng()); Log.Info("Whiteboard exported to " + text2); return text2; } catch (Exception arg) { Log.Error($"Whiteboard export failed at {text2}: {arg}"); return null; } } private void ChangeBrushRadius(int direction) { float num = SelectedToolRadius + selectedRadiusStep * (float)direction; float num2 = Mathf.Round(Mathf.Clamp(num, HUDSettings.MinimumBrushRadius, HUDSettings.MaximumBrushRadius) * 10f) / 10f; if (eraserSelected) { selectedEraserRadius = num2; } else { selectedBrushRadius = num2; } EndStroke(); playerSession?.ShowToolRadius(SelectedToolRadius); } private void ChangeRadiusStep(int direction) { float num = selectedRadiusStep + 0.1f * (float)direction; selectedRadiusStep = Mathf.Round(Mathf.Clamp(num, 0.1f, HUDSettings.MaximumBrushRadius) * 10f) / 10f; playerSession?.ShowToolRadius(SelectedToolRadius); } private void ReadBoardSave() { undoStarts.Clear(); PersistentDataContainer currentSave = DawnLib.GetCurrentSave(); if (currentSave == null) { Log.Error("Whiteboard could not find the save"); return; } PersistentDataContainer currentContract = DawnLib.GetCurrentContract(); byte[] array = null; byte[] array2 = null; bool flag = currentContract != null && !((DataContainer)currentSave).Has(SaveKey) && ((DataContainer)currentContract).TryGet<byte[]>(SaveKey, ref array); bool flag2 = currentContract != null && !((DataContainer)currentSave).Has(ToolSaveKey) && ((DataContainer)currentContract).TryGet<byte[]>(ToolSaveKey, ref array2); if (flag || flag2) { using (((DataContainer)currentSave).CreateEditContext()) { if (flag) { ((DataContainer)currentSave).Set<byte[]>(SaveKey, array); } if (flag2) { ((DataContainer)currentSave).Set<byte[]>(ToolSaveKey, array2); } } } byte[] array3 = default(byte[]); if (((DataContainer)currentSave).TryGet<byte[]>(ToolSaveKey, ref array3) && array3 != null) { bool flag3 = array3.Length == 6; int num = array3.Length; bool flag4 = (uint)(num - 5) <= 1u; if (!flag4 || array3[3] < 10 || array3[3] > 200 || array3[4] < 10 || array3[4] > 200 || (flag3 && (array3[5] < 1 || array3[5] > Mathf.RoundToInt(HUDSettings.MaximumBrushRadius * 10f)))) { Log.Error("Whiteboard tool save is invalid"); } else { rememberedColour.Value = (uint)((array3[0] << 16) | (array3[1] << 8) | array3[2]); rememberedBrushRadius.Value = array3[3]; rememberedEraserRadius.Value = array3[4]; if (flag3) { rememberedRadiusStep.Value = array3[5]; } } } byte[] array4 = default(byte[]); if (!((DataContainer)currentSave).TryGet<byte[]>(SaveKey, ref array4) || array4 == null || array4.Length == 0) { points.Clear(); saveDirty = false; return; } if (array4.Length % 9 != 0) { Log.Error("Whiteboard save has a bad point list"); return; } int num2 = array4.Length / 9; if (num2 > 49152) { Log.Error("Whiteboard save is over the point limit"); return; } for (int i = 0; i < num2; i++) { if (!WhiteboardPoint.ReadBytes(array4, i * 9).HasValidSaveValues) { Log.Error("Whiteboard save has a bad point list"); return; } } points.Clear(); for (int j = 0; j < num2; j++) { points.Add(WhiteboardPoint.ReadBytes(array4, j * 9)); } saveDirty = false; pointLimitLogged = num2 >= pointBudget; Log.Info($"Whiteboard loaded {num2} points"); } private void WriteBoardSave(PersistentDataContainer _) { WriteBoardSave(); } internal void WriteBoardSave() { if (!saveDirty) { return; } PersistentDataContainer currentSave = DawnLib.GetCurrentSave(); if (currentSave == null) { Log.Error("Whiteboard could not find the save"); return; } byte[] array = new byte[points.Count * 9]; uint value = rememberedColour.Value; byte[] array2 = new byte[6] { (byte)(value >> 16), (byte)(value >> 8), (byte)value, rememberedBrushRadius.Value, rememberedEraserRadius.Value, rememberedRadiusStep.Value }; for (int i = 0; i < points.Count; i++) { points[i].WriteBytes(array, i * 9); } using (((DataContainer)currentSave).CreateEditContext()) { ((DataContainer)currentSave).Set<byte[]>(SaveKey, array); ((DataContainer)currentSave).Set<byte[]>(ToolSaveKey, array2); } saveDirty = false; } private void PlayerLeft(ulong clientId) { if (drawerClientId.Value == clientId) { drawerClientId.Value = ulong.MaxValue; } } [Rpc(/*Could not decode attribute arguments.*/)] private void RequestBoardRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2125262591u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2125262591u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (drawerClientId.Value != ulong.MaxValue || (Object)(object)StartOfRound.Instance == (Object)null) { return; } ulong senderClientId = rpcParams.Receive.SenderClientId; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; PlayerControllerB val3 = null; for (int i = 0; i < allPlayerScripts.Length; i++) { if ((Object)(object)allPlayerScripts[i] != (Object)null && ((NetworkBehaviour)allPlayerScripts[i]).OwnerClientId == senderClientId && allPlayerScripts[i].isPlayerControlled) { val3 = allPlayerScripts[i]; break; } } if (!((Object)(object)val3 == (Object)null) && !val3.isPlayerDead) { float num = val3.grabDistance + 1f; Vector3 val4 = ((Component)val3).transform.position - ((Component)interactTrigger).transform.position; if (!(((Vector3)(ref val4)).sqrMagnitude > num * num)) { drawerClientId.Value = senderClientId; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ReleaseBoardRpc(uint colourRgb, byte brushRadiusTenths, byte eraserRadiusTenths, byte radiusStepTenths, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2990414993u, rpcParams, val, (SendTo)2, (RpcDelivery)0); BytePacker.WriteValueBitPacked(val2, colourRgb); ((FastBufferWriter)(ref val2)).WriteValueSafe<byte>(ref brushRadiusTenths, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<byte>(ref eraserRadiusTenths, default(ForPrimitives)); ((FastBufferWriter)(ref val2)).WriteValueSafe<byte>(ref radiusStepTenths, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2990414993u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (drawerClientId.Value == rpcParams.Receive.SenderClientId && brushRadiusTenths >= 10 && brushRadiusTenths <= 200 && eraserRadiusTenths >= 10 && eraserRadiusTenths <= 200 && radiusStepTenths >= 1 && radiusStepTenths <= Mathf.RoundToInt(HUDSettings.MaximumBrushRadius * 10f)) { rememberedColour.Value = colourRgb & 0xFFFFFF; rememberedBrushRadius.Value = brushRadiusTenths; rememberedEraserRadius.Value = eraserRadiusTenths; rememberedRadiusStep.Value = radiusStepTenths; saveDirty = true; drawerClientId.Value = ulong.MaxValue; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void ClearWhiteboardRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(3880346881u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 3880346881u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage == 1) { base.__rpc_exec_stage = (__RpcExecStage)0; if (drawerClientId.Value == rpcParams.Receive.SenderClientId) { points.Clear(); undoStarts.Clear(); pointLimitLogged = false; saveDirty = true; } } } [Rpc(/*Could not decode attribute arguments.*/)] private void UndoRpc(RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(1347974977u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((NetworkBehaviour)this).__endSendRpc(ref val2, 1347974977u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (drawerClientId.Value == rpcParams.Receive.SenderClientId && undoStarts.Count != 0) { int index = undoStarts.Count - 1; int num = undoStarts[index]; undoStarts.RemoveAt(index); for (int num2 = points.Count - 1; num2 >= num; num2--) { points.RemoveAt(num2); } pointLimitLogged = false; saveDirty = true; Log.Debug("Whiteboard undid one action"); } } [Rpc(/*Could not decode attribute arguments.*/)] private void SendPointRpc(WhiteboardPoint point, bool beginsAction, RpcParams rpcParams = default(RpcParams)) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Invalid comparison between Unknown and I4 //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager; if (networkManager == null || !networkManager.IsListening) { return; } if ((int)base.__rpc_exec_stage != 1) { RpcAttributeParams val = default(RpcAttributeParams); FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendRpc(2760138617u, rpcParams, val, (SendTo)2, (RpcDelivery)0); ((FastBufferWriter)(ref val2)).WriteValueSafe<WhiteboardPoint>(ref point, default(ForNetworkSerializable)); ((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref beginsAction, default(ForPrimitives)); ((NetworkBehaviour)this).__endSendRpc(ref val2, 2760138617u, rpcParams, val, (SendTo)2, (RpcDelivery)0); } if ((int)base.__rpc_exec_stage != 1) { return; } base.__rpc_exec_stage = (__RpcExecStage)0; if (drawerClientId.Value != rpcParams.Receive.SenderClientId) { return; } if (points.Count >= pointBudget) { if (!pointLimitLogged) { pointLimitLogged = true; Log.Warn($"Whiteboard hit the {pointBudget} point limit. This can be increased in the config."); } return; } point.Flags &= 3; byte radiusTenths = point.RadiusTenths; if ((radiusTenths >= 10 && radiusTenths <= 200) || 1 == 0) { if (beginsAction) { undoStarts.Add(points.Count); } points.Add(point); uint value = (uint)((point.Red << 16) | (point.Green << 8) | point.Blue); if (point.Erases) { rememberedEraserRadius.Value = point.RadiusTenths; } else { rememberedColour.Value = value; rememberedBrushRadius.Value = point.RadiusTenths; } saveDirty = true; } } protected override void __initializeVariables() { if (drawerClientId == null) { throw new Exception("DrawableWhiteboard.drawerClientId cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)drawerClientId).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)drawerClientId, "drawerClientId"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)drawerClientId); if (rememberedColour == null) { throw new Exception("DrawableWhiteboard.rememberedColour cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)rememberedColour).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)rememberedColour, "rememberedColour"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)rememberedColour); if (rememberedBrushRadius == null) { throw new Exception("DrawableWhiteboard.rememberedBrushRadius cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)rememberedBrushRadius).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)rememberedBrushRadius, "rememberedBrushRadius"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)rememberedBrushRadius); if (rememberedEraserRadius == null) { throw new Exception("DrawableWhiteboard.rememberedEraserRadius cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)rememberedEraserRadius).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)rememberedEraserRadius, "rememberedEraserRadius"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)rememberedEraserRadius); if (rememberedRadiusStep == null) { throw new Exception("DrawableWhiteboard.rememberedRadiusStep cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)rememberedRadiusStep).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)rememberedRadiusStep, "rememberedRadiusStep"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)rememberedRadiusStep); if (points == null) { throw new Exception("DrawableWhiteboard.points cannot be null. All NetworkVariableBase instances must be initialized."); } ((NetworkVariableBase)points).Initialize((NetworkBehaviour)(object)this); ((NetworkBehaviour)this).__nameNetworkVariable((NetworkVariableBase)(object)points, "points"); base.NetworkVariableFields.Add((NetworkVariableBase)(object)points); ((NetworkBehaviour)this).__initializeVariables(); } protected override void __initializeRpcs() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((NetworkBehaviour)this).__registerRpc(2125262591u, new RpcReceiveHandler(__rpc_handler_2125262591), "RequestBoardRpc"); ((NetworkBehaviour)this).__registerRpc(2990414993u, new RpcReceiveHandler(__rpc_handler_2990414993), "ReleaseBoardRpc"); ((NetworkBehaviour)this).__registerRpc(3880346881u, new RpcReceiveHandler(__rpc_handler_3880346881), "ClearWhiteboardRpc"); ((NetworkBehaviour)this).__registerRpc(1347974977u, new RpcReceiveHandler(__rpc_handler_1347974977), "UndoRpc"); ((NetworkBehaviour)this).__registerRpc(2760138617u, new RpcReceiveHandler(__rpc_handler_2760138617), "SendPointRpc"); ((NetworkBehaviour)this).__initializeRpcs(); } private static void __rpc_handler_2125262591(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((DrawableWhiteboard)(object)target).RequestBoardRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2990414993(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { uint colourRgb = default(uint); ByteUnpacker.ReadValueBitPacked(reader, ref colourRgb); byte brushRadiusTenths = default(byte); ((FastBufferReader)(ref reader)).ReadValueSafe<byte>(ref brushRadiusTenths, default(ForPrimitives)); byte eraserRadiusTenths = default(byte); ((FastBufferReader)(ref reader)).ReadValueSafe<byte>(ref eraserRadiusTenths, default(ForPrimitives)); byte radiusStepTenths = default(byte); ((FastBufferReader)(ref reader)).ReadValueSafe<byte>(ref radiusStepTenths, default(ForPrimitives)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((DrawableWhiteboard)(object)target).ReleaseBoardRpc(colourRgb, brushRadiusTenths, eraserRadiusTenths, radiusStepTenths, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_3880346881(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((DrawableWhiteboard)(object)target).ClearWhiteboardRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_1347974977(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((DrawableWhiteboard)(object)target).UndoRpc(ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } private static void __rpc_handler_2760138617(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) NetworkManager networkManager = target.NetworkManager; if (networkManager != null && networkManager.IsListening) { WhiteboardPoint point = default(WhiteboardPoint); ((FastBufferReader)(ref reader)).ReadValueSafe<WhiteboardPoint>(ref point, default(ForNetworkSerializable)); bool beginsAction = default(bool); ((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref beginsAction, default(ForPrimitives)); RpcParams ext = rpcParams.Ext; target.__rpc_exec_stage = (__RpcExecStage)1; ((DrawableWhiteboard)(object)target).SendPointRpc(point, beginsAction, ext); target.__rpc_exec_stage = (__RpcExecStage)0; } } protected internal override string __getTypeName() { return "DrawableWhiteboard"; } } public class WhiteboardColourWheel : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IDragHandler { [SerializeField] private RectTransform wheelRect; [SerializeField] private RectTransform selectionMarker; private float hue; private float saturation; private float brightness; public float Brightness => brightness; public event Action<Color>? ColourChanged; public void OnPointerDown(PointerEventData eventData) { MoveMarker(eventData); } public void OnDrag(PointerEventData eventData) { MoveMarker(eventData); } public void ChooseColour(Color colour) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) Color.RGBToHSV(colour, ref hue, ref saturation, ref brightness); float num = hue * MathF.PI * 2f; Rect rect = wheelRect.rect; float width = ((Rect)(ref rect)).width; rect = wheelRect.rect; float num2 = Mathf.Min(width, ((Rect)(ref rect)).height) * 0.5f; selectionMarker.anchoredPosition = num2 * saturation * new Vector2(Mathf.Cos(num), Mathf.Sin(num)); this.ColourChanged?.Invoke(Color.HSVToRGB(hue, saturation, brightness)); } public void ChangeBrightness(float value) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) brightness = Mathf.Clamp01(value); this.ColourChanged?.Invoke(Color.HSVToRGB(hue, saturation, brightness)); } private void MoveMarker(PointerEventData eventData) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); if (RectTransformUtility.ScreenPointToLocalPointInRectangle(wheelRect, eventData.position, eventData.pressEventCamera, ref val)) { Rect rect = wheelRect.rect; float width = ((Rect)(ref rect)).width; rect = wheelRect.rect; float num = Mathf.Min(width, ((Rect)(ref rect)).height) * 0.5f; Vector2 val2 = Vector2.ClampMagnitude(val, num); selectionMarker.anchoredPosition = val2; saturation = Mathf.Clamp01(((Vector2)(ref val2)).magnitude / num); hue = Mathf.Repeat(Mathf.Atan2(val2.y, val2.x) / (MathF.PI * 2f), 1f); this.ColourChanged?.Invoke(Color.HSVToRGB(hue, saturation, brightness)); } } } internal class WhiteboardDrawingSurface { private const int CircleSides = 12; private readonly DecalProjector drawingDecal; private readonly Material brushMaterial; private RenderTexture drawingTexture; private Texture2D colourSampleTexture; private Material? decalMaterialCopy; private Vector2[] circlePoints; private int brushColourId; private int drawnPointCount; private bool brushPassFailedLogged; internal int Width { get; } internal int Height { get; } internal WhiteboardDrawingSurface(DecalProjector drawingDecal, Material brushMaterial, int width, int height) { this.drawingDecal = drawingDecal; this.brushMaterial = brushMaterial; Width = width; Height = height; } internal bool Configure() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) int num = Shader.PropertyToID("_BaseColorMap"); brushColourId = Shader.PropertyToID("_BrushColor"); Material material = drawingDecal.material; circlePoints = (Vector2[])(object)new Vector2[13]; for (int i = 0; i <= 12; i++) { float num2 = MathF.PI * 2f * (float)i / 12f; circlePoints[i] = new Vector2(Mathf.Cos(num2), Mathf.Sin(num2)); } drawingTexture = new RenderTexture(Width, Height, 0, (RenderTextureFormat)0, (RenderTextureReadWrite)2) { name = "Drawable whiteboard drawing", filterMode = (FilterMode)1, wrapMode = (TextureWrapMode)1, useMipMap = false, autoGenerateMips = false }; if (!drawingTexture.Create()) { Log.Error("Whiteboard drawing texture could not be made"); return false; } colourSampleTexture = new Texture2D(1, 1, (TextureFormat)4, false, false) { name = "Drawable whiteboard colour sample" }; decalMaterialCopy = new Material(material) { name = ((Object)material).name + " Whiteboard" }; decalMaterialCopy.SetTexture(num, (Texture)(object)drawingTexture); decalMaterialCopy.SetColor("_BaseColor", Color.white); decalMaterialCopy.SetFloat("_DecalBlend", 1f); decalMaterialCopy.SetFloat("_AffectAlbedo", 1f); HDMaterial.ValidateMaterial(decalMaterialCopy); drawingDecal.material = decalMaterialCopy; drawingDecal.uvScale = Vector2.one; drawingDecal.uvBias = Vector2.zero; drawingDecal.fadeFactor = 1f; Clear(); return true; } internal void Restart(NetworkList<WhiteboardPoint> points) { Clear(); drawnPointCount = 0; DrawMissing(points); } internal void DrawMissing(NetworkList<WhiteboardPoint> points) { if (drawnPointCount > points.Count) { Clear(); drawnPointCount = 0; } if (drawnPointCount == points.Count) { return; } RenderTexture active = RenderTexture.active; RenderTexture.active = drawingTexture; GL.PushMatrix(); GL.LoadOrtho(); while (drawnPointCount < points.Count) { int num = drawnPointCount; WhiteboardPoint point = points[num]; if (!DrawPoint(point, (num > 0) ? points[num - 1] : default(WhiteboardPoint), num > 0 && !point.StartsStroke)) { break; } drawnPointCount++; } GL.PopMatrix(); ((Texture)drawingTexture).IncrementUpdateCount(); RenderTexture.active = active; } internal bool DrawLocal(WhiteboardPoint point, WhiteboardPoint previousPoint, bool drawLine) { RenderTexture active = RenderTexture.active; RenderTexture.active = drawingTexture; GL.PushMatrix(); GL.LoadOrtho(); bool flag = DrawPoint(point, previousPoint, drawLine); GL.PopMatrix(); if (flag) { ((Texture)drawingTexture).IncrementUpdateCount(); } RenderTexture.active = active; return flag; } internal byte[] ExportPng() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) RenderTexture active = RenderTexture.active; Texture2D val = new Texture2D(Width, Height, (TextureFormat)4, false, false); try { RenderTexture.active = drawingTexture; val.ReadPixels(new Rect(0f, 0f, (float)Width, (float)Height), 0, 0, false); val.Apply(false); Color32[] pixels = val.GetPixels32(); for (int i = 0; i < pixels.Length; i++) { int a = pixels[i].a; int num = 255 * (255 - a); pixels[i].r = (byte)((pixels[i].r * a + num) / 255); pixels[i].g = (byte)((pixels[i].g * a + num) / 255); pixels[i].b = (byte)((pixels[i].b * a + num) / 255); pixels[i].a = byte.MaxValue; } val.SetPixels32(pixels); val.Apply(false); return ImageConversion.EncodeToPNG(val); } finally { RenderTexture.active = active; Object.Destroy((Object)(object)val); } } internal bool SampleColour(Vector2 uv, out Color32 colour) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) int num = Mathf.Clamp(Mathf.FloorToInt(uv.x * (float)Width), 0, Width - 1); int num2 = Mathf.Clamp(Mathf.FloorToInt(uv.y * (float)Height), 0, Height - 1); RenderTexture active = RenderTexture.active; try { RenderTexture.active = drawingTexture; colourSampleTexture.ReadPixels(new Rect((float)num, (float)num2, 1f, 1f), 0, 0, false); colour = colourSampleTexture.GetRawTextureData<Color32>()[0]; return colour.a != 0; } finally { RenderTexture.active = active; } } internal void Release() { if ((Object)(object)drawingTexture != (Object)null) { drawingTexture.Release(); Object.Destroy((Object)(object)drawingTexture); } if ((Object)(object)colourSampleTexture != (Object)null) { Object.Destroy((Object)(object)colourSampleTexture); } if ((Object)(object)decalMaterialCopy != (Object)null) { Object.Destroy((Object)(object)decalMaterialCopy); } } private void Clear() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) RenderTexture active = RenderTexture.active; RenderTexture.active = drawingTexture; GL.Clear(true, true, Color.clear); ((Texture)drawingTexture).IncrementUpdateCount(); RenderTexture.active = active; } private bool DrawPoint(WhiteboardPoint point, WhiteboardPoint previousPoint, bool drawLine) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) brushMaterial.SetColor(brushColourId, Color32.op_Implicit(new Color32(point.Red, point.Green, point.Blue, byte.MaxValue))); if (!brushMaterial.SetPass(point.Erases ? 1 : 0)) { if (!brushPassFailedLogged) { brushPassFailedLogged = true; Log.Error("Whiteboard brush material pass could not be used"); } return false; } GL.Begin(4); Vector2 val = PointUv(point); float radius = (float)(int)point.RadiusTenths / 10f; if (drawLine) { DrawLine(PointUv(previousPoint), val, radius); } else { DrawDot(val, radius); } GL.End(); return true; } private void DrawLine(Vector2 start, Vector2 end, float radius) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(start.x * (float)Width, start.y * (float)Height); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(end.x * (float)Width, end.y * (float)Height); Vector2 val3 = val2 - val; if (((Vector2)(ref val3)).sqrMagnitude <= 0.0001f) { DrawDot(end, radius); return; } Vector2 val4 = new Vector2(0f - val3.y, val3.x); Vector2 val5 = ((Vector2)(ref val4)).normalized * radius; Vector2 val6 = default(Vector2); ((Vector2)(ref val6))..ctor(val5.x / (float)Width, val5.y / (float)Height); Vector2 val7 = start + val6; Vector2 val8 = start - val6; Vector2 val9 = end - val6; Vector2 val10 = end + val6; GL.Vertex3(val7.x, val7.y, 0f); GL.Vertex3(val8.x, val8.y, 0f); GL.Vertex3(val9.x, val9.y, 0f); GL.Vertex3(val7.x, val7.y, 0f); GL.Vertex3(val9.x, val9.y, 0f); GL.Vertex3(val10.x, val10.y, 0f); DrawDot(end, radius); } private void DrawDot(Vector2 center, float radius) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) float num = radius / (float)Width; float num2 = radius / (float)Height; for (int i = 0; i < 12; i++) { Vector2 val = center + new Vector2(circlePoints[i].x * num, circlePoints[i].y * num2); Vector2 val2 = center + new Vector2(circlePoints[i + 1].x * num, circlePoints[i + 1].y * num2); GL.Vertex3(center.x, center.y, 0f); GL.Vertex3(val.x, val.y, 0f); GL.Vertex3(val2.x, val2.y, 0f); } } private static Vector2 PointUv(WhiteboardPoint point) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) return new Vector2((float)(int)point.X / 65535f, (float)(int)point.Y / 65535f); } } public class WhiteboardHUD : MonoBehaviour { [CompilerGenerated] private static class <>O { public static OnValidateInput <0>__ValidateHexCharacter; } [Header("Toolbar")] [SerializeField] private Button colourButton; [SerializeField] private Button colourPickerButton; [SerializeField] private Image colourPickerIcon; [SerializeField] private Image selectedColour; [SerializeField] private Button toolButton; [SerializeField] private Image toolButtonIcon; [SerializeField] private Button clearButton; [SerializeField] private Button undoButton; [SerializeField] private Button exportButton; [Header("Colour Popup")] [SerializeField] private GameObject colourPopup; [SerializeField] private WhiteboardColourWheel colourWheel; [SerializeField] private Slider brightnessSlider; [SerializeField] private Image colourPreview; [SerializeField] private TMP_InputField colourHexInput; [SerializeField] private Button closeColourButton; [Header("Clear Popup")] [SerializeField] private GameObject clearPopup; [SerializeField] private Button confirmClearButton; [SerializeField] private Button cancelClearButton; [Header("Export Popup")] [SerializeField] private GameObject exportPopup; [SerializeField] private TextMeshProUGUI exportPathText; [SerializeField] private Button closeExportButton; [Header("Cursor and Tips")] [SerializeField] private RectTransform cursorRect; [SerializeField] private Image cursorImage; [SerializeField] private Image colourPickerCursorColour; private readonly List<RaycastResult> pointerHits = new List<RaycastResult>(8); private RectTransform hudRect; private Canvas hudCanvas; private DrawableWhiteboard whiteboard; private WhiteboardHUDSettings settings; private PointerEventData pointerData; private TextMeshProUGUI tooltipText; private bool simpleToolCursors; public bool BlocksDrawing { get { if (!colourPopup.activeSelf && !clearPopup.activeSelf) { return exportPopup.activeSelf; } return true; } } private void Awake() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown hudRect = (RectTransform)((Component)this).transform; hudCanvas = ((Component)this).GetComponentInParent<Canvas>(); ((UnityEvent)colourButton.onClick).AddListener(new UnityAction(OpenColourPopup)); ((UnityEvent)colourPickerButton.onClick).AddListener(new UnityAction(SelectColourPicker)); ((UnityEvent)toolButton.onClick).AddListener(new UnityAction(ToggleTool)); ((UnityEvent)clearButton.onClick).AddListener(new UnityAction(OpenClearPopup)); ((UnityEvent)undoButton.onClick).AddListener(new UnityAction(Undo)); ((UnityEvent)exportButton.onClick).AddListener(new UnityAction(Export)); ((UnityEvent)closeColourButton.onClick).AddListener(new UnityAction(CloseColourPopup)); ((UnityEvent)confirmClearButton.onClick).AddListener(new UnityAction(ConfirmClear)); ((UnityEvent)cancelClearButton.onClick).AddListener(new UnityAction(CloseClearPopup)); ((UnityEvent)closeExportButton.onClick).AddListener(new UnityAction(CloseExportPopup)); ((UnityEvent<float>)(object)brightnessSlider.onValueChanged).AddListener((UnityAction<float>)ChangeBrightness); TMP_InputField obj = colourHexInput; OnValidateInput onValidateInput = obj.onValidateInput; object obj2 = <>O.<0>__ValidateHexCharacter; if (obj2 == null) { OnValidateInput val = ValidateHexCharacter; <>O.<0>__ValidateHexCharacter = val; obj2 = (object)val; } obj.onValidateInput = (OnValidateInput)Delegate.Combine((Delegate?)(object)onValidateInput, (Delegate?)obj2); ((UnityEvent<string>)(object)colourHexInput.onValueChanged).AddListener((UnityAction<string>)ChangeHexColour); ((UnityEvent<string>)(object)colourHexInput.onEndEdit).AddListener((UnityAction<string>)FinishHexEdit); colourWheel.ColourChanged += ChangeColour; } private void LateUpdate() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (Mouse.current != null) { Camera val = null; if ((int)hudCanvas.renderMode != 0) { val = hudCanvas.worldCamera; } Vector2 anchoredPosition = default(Vector2); if (RectTransformUtility.ScreenPointToLocalPointInRectangle(hudRect, ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(), val, ref anchoredPosition)) { cursorRect.anchoredPosition = anchoredPosition; } } } public void Open(WhiteboardHUDSettings hudSettings) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) whiteboard = DrawableWhiteboard.Instance; settings = hudSettings; simpleToolCursors = ConfigManager.SimpleToolCursors.Value; pointerData = new PointerEventData(EventSystem.current); TMP_FontAsset font = ((TMP_Text)HUDManager.Instance.controlTipLines[0]).font; TextMeshProUGUI[] componentsInChildren = ((Component)this).GetComponentsInChildren<TextMeshProUGUI>(true); for (int i = 0; i < componentsInChildren.Length; i++) { ((TMP_Text)componentsInChildren[i]).font = font; ((TMP_Text)componentsInChildren[i]).fontSharedMaterial = ((TMP_Asset)font).material; if (((Object)componentsInChildren[i]).name == "TooltipText") { tooltipText = componentsInChildren[i]; } } RefreshToolVisuals(); colourWheel.ChooseColour(whiteboard.SelectedBrushColour); brightnessSlider.SetValueWithoutNotify(colourWheel.Brightness); } public bool HasPointer(Vector2 screenPosition) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) pointerData.position = screenPosition; pointerHits.Clear(); EventSystem.current.RaycastAll(pointerData, pointerHits); for (int i = 0; i < pointerHits.Count; i++) { RaycastResult val = pointerHits[i]; if (((RaycastResult)(ref val)).gameObject.transform.IsChildOf(((Component)this).transform)) { return true; } } return false; } private void OpenColourPopup() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) clearPopup.SetActive(false); exportPopup.SetActive(false); colourPopup.SetActive(true); colourWheel.ChooseColour(whiteboard.SelectedBrushColour); brightnessSlider.SetValueWithoutNotify(colourWheel.Brightness); RefreshCursorVisual(); } private void CloseColourPopup() { colourPopup.SetActive(false); RefreshCursorVisual(); } private void ToggleTool() { whiteboard.ToggleDrawingTool(); RefreshToolVisuals(); EventSystem.current.SetSelectedGameObject((GameObject)null); } private void SelectColourPicker() { whiteboard.SelectColourPicker(); RefreshToolVisuals(); EventSystem.current.SetSelectedGameObject((GameObject)null); } private void OpenClearPopup() { colourPopup.SetActive(false); exportPopup.SetActive(false); clearPopup.SetActive(true); RefreshCursorVisual(); } private void ConfirmClear() { clearPopup.SetActive(false); RefreshCursorVisual(); whiteboard.ClearWhiteboard(); } private void CloseClearPopup() { clearPopup.SetActive(false); RefreshCursorVisual(); } private void Undo() { whiteboard.UndoWhiteboard(); EventSystem.current.SetSelectedGameObject((GameObject)null); } private void Export() { string text = whiteboard.ExportWhiteboard(); if (text != null) { colourPopup.SetActive(false); clearPopup.SetActive(false); ((TMP_Text)exportPathText).text = text; exportPopup.SetActive(true); RefreshCursorVisual(); } EventSystem.current.SetSelectedGameObject((GameObject)null); } private void CloseExportPopup() { exportPopup.SetActive(false); RefreshCursorVisual(); } private void ChangeBrightness(float value) { colourWheel.ChangeBrightness(value); } private static char ValidateHexCharacter(string text, int characterIndex, char addedCharacter) { if (addedCharacter == '#' && characterIndex == 0 && !text.Contains('#')) { return addedCharacter; } if ((addedCharacter >= '0' && addedCharacter <= '9') || (addedCharacter >= 'A' && addedCharacter <= 'F') || (addedCharacter >= 'a' && addedCharacter <= 'f')) { return char.ToUpperInvariant(addedCharacter); } return '\0'; } private void ChangeHexColour(string value) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) string text = (value.StartsWith("#") ? value : ("#" + value)); Color colour = default(Color); if (text.Length == 7 && ColorUtility.TryParseHtmlString(text, ref colour)) { colourWheel.ChooseColour(colour); brightnessSlider.SetValueWithoutNotify(colourWheel.Brightness); } } private void FinishHexEdit(string _) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) colourHexInput.SetTextWithoutNotify("#" + ColorUtility.ToHtmlStringRGB(whiteboard.SelectedBrushColour)); } private void ChangeColour(Color colour) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ((Graphic)colourPreview).color = colour; ((Graphic)selectedColour).color = colour; ((Graphic)colourPickerCursorColour).color = colour; colourHexInput.SetTextWithoutNotify("#" + ColorUtility.ToHtmlStringRGB(colour)); whiteboard.ChooseBrushColour(colour); } internal void ShowToolRadius(float radius) { string arg = (whiteboard.EraserSelected ? "Eraser" : "Brush"); ((TMP_Text)tooltipText).text = $"{arg}: {radius:F1} px [Wheel] Resize by {whiteboard.SelectedRadiusStep:F1} px [-/+] Change step [Ctrl+Z] Undo [Esc] Exit"; } internal void PreviewPickerColour(Color colour) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) ((Graphic)colourPickerCursorColour).color = colour; } internal void RefreshToolVisuals() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) colourPickerIcon.sprite = settings.ColourPickerIcon; ((Graphic)selectedColour).color = whiteboard.SelectedBrushColour; ((Graphic)colourPickerCursorColour).color = whiteboard.SelectedBrushColour; toolButtonIcon.sprite = (whiteboard.EraserSelected ? settings.BrushIcon : settings.EraserIcon); if (whiteboard.ColourPickerSelected) { ((TMP_Text)tooltipText).text = "Colour picker [Click] Pick colour [Ctrl+Z] Undo [Esc] Exit"; } else { ShowToolRadius(whiteboard.SelectedToolRadius); } RefreshCursorVisual(); } private void RefreshCursorVisual() { ((Component)colourPickerCursorColour).gameObject.SetActive(!BlocksDrawing && whiteboard.ColourPickerSelected); cursorImage.sprite = (BlocksDrawing ? settings.PopupCursor : (whiteboard.ColourPickerSelected ? settings.ColourPickerCursor : (simpleToolCursors ? settings.SimpleCursor : (whiteboard.EraserSelected ? settings.EraserCursor : settings.BrushCursor)))); } } [CreateAssetMenu(menuName = "Drawable Whiteboard/HUD Settings", fileName = "WhiteboardHUDSettings")] public class WhiteboardHUDSettings : ScriptableObject { [Header("HUD")] [SerializeField] private WhiteboardHUD hudPrefab; [SerializeField] private Sprite brushIcon; [SerializeField] private Sprite eraserIcon; [SerializeField] private Sprite colourPickerIcon; [Header("Cursors")] [SerializeField] private Sprite brushCursor; [SerializeField] private Sprite eraserCursor; [SerializeField] private Sprite colourPickerCursor; [SerializeField] private Sprite popupCursor; [SerializeField] private Sprite simpleCursor; [Header("Brush Size")] [SerializeField] private float minimumBrushRadius = 1f; [SerializeField] private float maximumBrushRadius = 20f; [SerializeField] private float brushRadiusStep = 0.1f; public WhiteboardHUD HUDPrefab => hudPrefab; public Sprite BrushIcon => brushIcon; public Sprite EraserIcon => eraserIcon; public Sprite ColourPickerIcon => colourPickerIcon; public Sprite BrushCursor => brushCursor; public Sprite EraserCursor => eraserCursor; public Sprite ColourPickerCursor => colourPickerCursor; public Sprite PopupCursor => popupCursor; public Sprite SimpleCursor => simpleCursor; public float MinimumBrushRadius => minimumBrushRadius; public float MaximumBrushRadius => maximumBrushRadius; public float BrushRadiusStep => brushRadiusStep; } internal class WhiteboardPlayerSession { private readonly HUDElement[] hiddenHUDElements; private readonly TextMeshProUGUI[] controlTipLines; private readonly float[] oldHUDAlphas; private readonly float[] oldHUDTargetAlphas; private readonly bool[] oldHUDInteractable; private readonly bool[] oldHUDBlocksRaycasts; private readonly Vector3 oldCameraLocalPosition; private readonly Quaternion oldCameraLocalRotation; private readonly CursorLockMode oldCursorLockMode; private readonly bool oldCursorVisible; private readonly bool oldDisableMoveInput; private readonly bool oldDisableLookInput; private readonly bool oldDisableInteract; private readonly bool oldVisorActive; private readonly bool oldArmsEnabled; private readonly Renderer[] playerRenderers; private readonly bool[] oldPlayerRendererForceRenderingOff; private readonly WhiteboardHUD hud; internal PlayerControllerB Player { get; } internal bool BlocksDrawing => hud.BlocksDrawing; internal WhiteboardPlayerSession(PlayerControllerB player, Transform cameraPosition, WhiteboardHUDSettings settings) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unk