using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using UnityEngine; using UnityEngine.Bindings; using UnityEngine.Scripting; [assembly: InternalsVisibleTo("UnityEngine.SubstanceModule")] [assembly: InternalsVisibleTo("UnityEngine.Networking")] [assembly: InternalsVisibleTo("UnityEngine.Cloud")] [assembly: InternalsVisibleTo("UnityEngine.Cloud.Service")] [assembly: InternalsVisibleTo("Unity.Analytics")] [assembly: InternalsVisibleTo("UnityEngine.Analytics")] [assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsCommon")] [assembly: InternalsVisibleTo("UnityEngine.Advertisements")] [assembly: InternalsVisibleTo("UnityEngine.Purchasing")] [assembly: InternalsVisibleTo("UnityEngine.TestRunner")] [assembly: InternalsVisibleTo("Unity.Automation")] [assembly: InternalsVisibleTo("Unity.Burst")] [assembly: InternalsVisibleTo("Unity.Burst.Editor")] [assembly: InternalsVisibleTo("Unity.DeploymentTests.Services")] [assembly: InternalsVisibleTo("Unity.IntegrationTests")] [assembly: InternalsVisibleTo("Unity.IntegrationTests.UnityAnalytics")] [assembly: InternalsVisibleTo("Unity.IntegrationTests.Timeline")] [assembly: InternalsVisibleTo("Unity.IntegrationTests.Framework")] [assembly: InternalsVisibleTo("Unity.RuntimeTests")] [assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework")] [assembly: InternalsVisibleTo("Unity.RuntimeTests.Framework.Tests")] [assembly: InternalsVisibleTo("Unity.PerformanceTests.RuntimeTestRunner.Tests")] [assembly: InternalsVisibleTo("Unity.RuntimeTests.AllIn1Runner")] [assembly: InternalsVisibleTo("Unity.Timeline")] [assembly: InternalsVisibleTo("UnityEngine.PS5VRModule")] [assembly: InternalsVisibleTo("UnityEngine.PS5Module")] [assembly: InternalsVisibleTo("UnityEngine.PS4VRModule")] [assembly: InternalsVisibleTo("UnityEngine.PS4Module")] [assembly: InternalsVisibleTo("UnityEngine.TerrainPhysicsModule")] [assembly: InternalsVisibleTo("UnityEngine.TextCoreFontEngineModule")] [assembly: InternalsVisibleTo("UnityEngine.TextCoreTextEngineModule")] [assembly: InternalsVisibleTo("UnityEngine.TilemapModule")] [assembly: InternalsVisibleTo("UnityEngine.UIModule")] [assembly: InternalsVisibleTo("UnityEngine.UIElementsNativeModule")] [assembly: InternalsVisibleTo("UnityEngine.UIElementsModule")] [assembly: InternalsVisibleTo("UnityEngine.UmbraModule")] [assembly: InternalsVisibleTo("UnityEngine.UNETModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityCurlModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityTestProtocolModule")] [assembly: InternalsVisibleTo("Assembly-CSharp-testable")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAssetBundleModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestTextureModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestWWWModule")] [assembly: InternalsVisibleTo("UnityEngine.VehiclesModule")] [assembly: InternalsVisibleTo("UnityEngine.VFXModule")] [assembly: InternalsVisibleTo("UnityEngine.VideoModule")] [assembly: InternalsVisibleTo("UnityEngine.VirtualTexturingModule")] [assembly: InternalsVisibleTo("UnityEngine.XRModule")] [assembly: InternalsVisibleTo("UnityEngine.VRModule")] [assembly: InternalsVisibleTo("UnityEngine.WindModule")] [assembly: InternalsVisibleTo("UnityEngine.SwitchModule")] [assembly: InternalsVisibleTo("UnityEngine.XboxOneModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestAudioModule")] [assembly: InternalsVisibleTo("UnityEngine.TerrainModule")] [assembly: InternalsVisibleTo("Assembly-CSharp-firstpass-testable")] [assembly: InternalsVisibleTo("GoogleAR.UnityNative")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.008")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.009")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.010")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.011")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.012")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.013")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.014")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.015")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.016")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.017")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.018")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.019")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.020")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.021")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.022")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.023")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.024")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.001")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.002")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.003")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.004")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridgeDev.005")] [assembly: InternalsVisibleTo("Unity.Subsystem.Registration")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.007")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.006")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.005")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.004")] [assembly: InternalsVisibleTo("Unity.WindowsMRAutomation")] [assembly: InternalsVisibleTo("Unity.2D.Sprite.Editor")] [assembly: InternalsVisibleTo("Unity.2D.Sprite.EditorTests")] [assembly: InternalsVisibleTo("Unity.UI.Builder.Editor")] [assembly: InternalsVisibleTo("UnityEditor.UIBuilderModule")] [assembly: InternalsVisibleTo("Unity.UI.Builder.EditorTests")] [assembly: InternalsVisibleTo("Unity.UIElements")] [assembly: InternalsVisibleTo("UnityEngine.UIElementsGameObjectsModule")] [assembly: InternalsVisibleTo("Unity.UIElements.Editor")] [assembly: InternalsVisibleTo("Unity.UIElements.PlayModeTests")] [assembly: InternalsVisibleTo("Unity.UIElements.EditorTests")] [assembly: InternalsVisibleTo("UnityEngine.SpatialTracking")] [assembly: InternalsVisibleTo("UnityEngine.UI")] [assembly: InternalsVisibleTo("Unity.ucg.QoS")] [assembly: InternalsVisibleTo("Unity.Services.QoS")] [assembly: InternalsVisibleTo("Unity.Logging")] [assembly: InternalsVisibleTo("Unity.Entities")] [assembly: InternalsVisibleTo("Unity.Entities.Tests")] [assembly: InternalsVisibleTo("Unity.Collections")] [assembly: InternalsVisibleTo("Unity.Runtime")] [assembly: InternalsVisibleTo("Unity.Core")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.001")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.002")] [assembly: InternalsVisibleTo("Unity.InternalAPIEngineBridge.003")] [assembly: InternalsVisibleTo("Unity.Networking.Transport")] [assembly: InternalsVisibleTo("UnityEngine.SubsystemsModule")] [assembly: InternalsVisibleTo("UnityEngine.SpriteShapeModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityConnectModule")] [assembly: InternalsVisibleTo("UnityEngine.ClusterRendererModule")] [assembly: InternalsVisibleTo("UnityEngine.ClusterInputModule")] [assembly: InternalsVisibleTo("UnityEngine.ClothModule")] [assembly: InternalsVisibleTo("UnityEngine.AudioModule")] [assembly: InternalsVisibleTo("UnityEngine.AssetBundleModule")] [assembly: InternalsVisibleTo("UnityEngine.HotReloadModule")] [assembly: InternalsVisibleTo("UnityEngine.ARModule")] [assembly: InternalsVisibleTo("UnityEngine.InputModule")] [assembly: InternalsVisibleTo("UnityEngine.JSONSerializeModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsCommonModule")] [assembly: InternalsVisibleTo("UnityEngine.PhysicsModule")] [assembly: InternalsVisibleTo("UnityEngine.AndroidJNIModule")] [assembly: InternalsVisibleTo("UnityEngine.AIModule")] [assembly: InternalsVisibleTo("UnityEngine.AccessibilityModule")] [assembly: InternalsVisibleTo("UnityEngine.CoreModule")] [assembly: InternalsVisibleTo("UnityEngine.SharedInternalsModule")] [assembly: InternalsVisibleTo("UnityEngine")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: InternalsVisibleTo("UnityEngine.AnimationModule")] [assembly: InternalsVisibleTo("UnityEngine.TLSModule")] [assembly: InternalsVisibleTo("UnityEngine.StreamingModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityAnalyticsModule")] [assembly: UnityEngineModuleAssembly] [assembly: InternalsVisibleTo("UnityEngine.SpriteMaskModule")] [assembly: InternalsVisibleTo("UnityEngine.ScreenCaptureModule")] [assembly: InternalsVisibleTo("UnityEngine.RuntimeInitializeOnLoadManagerInitializerModule")] [assembly: InternalsVisibleTo("UnityEngine.ProfilerModule")] [assembly: InternalsVisibleTo("UnityEngine.Physics2DModule")] [assembly: InternalsVisibleTo("UnityEngine.PerformanceReportingModule")] [assembly: InternalsVisibleTo("UnityEngine.ParticleSystemModule")] [assembly: InternalsVisibleTo("UnityEngine.UnityWebRequestModule")] [assembly: InternalsVisibleTo("UnityEngine.LocalizationModule")] [assembly: InternalsVisibleTo("UnityEngine.NVIDIAModule")] [assembly: InternalsVisibleTo("UnityEngine.InputLegacyModule")] [assembly: InternalsVisibleTo("UnityEngine.TextRenderingModule")] [assembly: InternalsVisibleTo("UnityEngine.GridModule")] [assembly: InternalsVisibleTo("UnityEngine.GIModule")] [assembly: InternalsVisibleTo("UnityEngine.GameCenterModule")] [assembly: InternalsVisibleTo("UnityEngine.ImageConversionModule")] [assembly: InternalsVisibleTo("UnityEngine.DSPGraphModule")] [assembly: InternalsVisibleTo("UnityEngine.DirectorModule")] [assembly: InternalsVisibleTo("UnityEngine.CrashReportingModule")] [assembly: InternalsVisibleTo("UnityEngine.IMGUIModule")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] namespace UnityEngine; public interface ICanvasRaycastFilter { bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera); } [NativeHeader("Modules/UI/CanvasGroup.h")] [NativeClass("UI::CanvasGroup")] public sealed class CanvasGroup : Behaviour, ICanvasRaycastFilter { [NativeProperty(/*Could not decode attribute arguments.*/)] public extern float alpha { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern bool interactable { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern bool blocksRaycasts { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern bool ignoreParentGroups { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera) { return blocksRaycasts; } } [NativeHeader("Modules/UI/CanvasRenderer.h")] [NativeClass("UI::CanvasRenderer")] public sealed class CanvasRenderer : Component { public extern bool hasPopInstruction { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int materialCount { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int popMaterialCount { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int absoluteDepth { [MethodImpl(MethodImplOptions.InternalCall)] get; } public extern bool hasMoved { [MethodImpl(MethodImplOptions.InternalCall)] get; } public extern bool cullTransparentMesh { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern bool hasRectClipping { [MethodImpl(MethodImplOptions.InternalCall)] get; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern int relativeDepth { [MethodImpl(MethodImplOptions.InternalCall)] get; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern bool cull { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } [Obsolete("isMask is no longer supported.See EnableClipping for vertex clipping configuration", false)] public bool isMask { get; set; } public Vector2 clippingSoftness { get { //IL_0008: Unknown result type (might be due to invalid IL or missing references) get_clippingSoftness_Injected(out var ret); return ret; } set { set_clippingSoftness_Injected(ref value); } } public void SetColor(Color color) { SetColor_Injected(ref color); } public Color GetColor() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) GetColor_Injected(out var ret); return ret; } public void EnableRectClipping(Rect rect) { EnableRectClipping_Injected(ref rect); } [MethodImpl(MethodImplOptions.InternalCall)] public extern void DisableRectClipping(); [MethodImpl(MethodImplOptions.InternalCall)] public extern void SetMaterial(Material material, int index); [MethodImpl(MethodImplOptions.InternalCall)] public extern Material GetMaterial(int index); [MethodImpl(MethodImplOptions.InternalCall)] public extern void SetPopMaterial(Material material, int index); [MethodImpl(MethodImplOptions.InternalCall)] public extern Material GetPopMaterial(int index); [MethodImpl(MethodImplOptions.InternalCall)] public extern void SetTexture(Texture texture); [MethodImpl(MethodImplOptions.InternalCall)] public extern void SetAlphaTexture(Texture texture); [MethodImpl(MethodImplOptions.InternalCall)] public extern void SetMesh(Mesh mesh); [MethodImpl(MethodImplOptions.InternalCall)] public extern void Clear(); public float GetAlpha() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return GetColor().a; } public void SetAlpha(float alpha) { //IL_0002: 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_0011: Unknown result type (might be due to invalid IL or missing references) Color color = GetColor(); color.a = alpha; SetColor(color); } [MethodImpl(MethodImplOptions.InternalCall)] public extern float GetInheritedAlpha(); public void SetMaterial(Material material, Texture texture) { materialCount = Math.Max(1, materialCount); SetMaterial(material, 0); SetTexture(texture); } public Material GetMaterial() { return GetMaterial(0); } public static void SplitUIVertexStreams(List verts, List positions, List colors, List uv0S, List uv1S, List normals, List tangents, List indices) { SplitUIVertexStreams(verts, positions, colors, uv0S, uv1S, new List(), new List(), normals, tangents, indices); } public static void SplitUIVertexStreams(List verts, List positions, List colors, List uv0S, List uv1S, List uv2S, List uv3S, List normals, List tangents, List indices) { SplitUIVertexStreamsInternal(verts, positions, colors, uv0S, uv1S, uv2S, uv3S, normals, tangents); SplitIndicesStreamsInternal(verts, indices); } public static void CreateUIVertexStream(List verts, List positions, List colors, List uv0S, List uv1S, List normals, List tangents, List indices) { CreateUIVertexStream(verts, positions, colors, uv0S, uv1S, new List(), new List(), normals, tangents, indices); } public static void CreateUIVertexStream(List verts, List positions, List colors, List uv0S, List uv1S, List uv2S, List uv3S, List normals, List tangents, List indices) { CreateUIVertexStreamInternal(verts, positions, colors, uv0S, uv1S, uv2S, uv3S, normals, tangents, indices); } public static void AddUIVertexStream(List verts, List positions, List colors, List uv0S, List uv1S, List normals, List tangents) { AddUIVertexStream(verts, positions, colors, uv0S, uv1S, new List(), new List(), normals, tangents); } public static void AddUIVertexStream(List verts, List positions, List colors, List uv0S, List uv1S, List uv2S, List uv3S, List normals, List tangents) { SplitUIVertexStreamsInternal(verts, positions, colors, uv0S, uv1S, uv2S, uv3S, normals, tangents); } [Obsolete("UI System now uses meshes.Generate a mesh and use 'SetMesh' instead", false)] public void SetVertices(List vertices) { SetVertices(vertices.ToArray(), vertices.Count); } [Obsolete("UI System now uses meshes.Generate a mesh and use 'SetMesh' instead", false)] public void SetVertices(UIVertex[] vertices, int size) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0061: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); List list = new List(); List list2 = new List(); List list3 = new List(); List list4 = new List(); List list5 = new List(); List list6 = new List(); List list7 = new List(); List list8 = new List(); List list9 = new List(); for (int i = 0; i < size; i += 4) { for (int j = 0; j < 4; j++) { list.Add(vertices[i + j].position); list2.Add(vertices[i + j].color); list3.Add(vertices[i + j].uv0); list4.Add(vertices[i + j].uv1); list5.Add(vertices[i + j].uv2); list6.Add(vertices[i + j].uv3); list7.Add(vertices[i + j].normal); list8.Add(vertices[i + j].tangent); } list9.Add(i); list9.Add(i + 1); list9.Add(i + 2); list9.Add(i + 2); list9.Add(i + 3); list9.Add(i); } val.SetVertices(list); val.SetColors(list2); val.SetNormals(list7); val.SetTangents(list8); val.SetUVs(0, list3); val.SetUVs(1, list4); val.SetUVs(2, list5); val.SetUVs(3, list6); val.SetIndices(list9.ToArray(), (MeshTopology)0, 0); SetMesh(val); Object.DestroyImmediate((Object)(object)val); } [MethodImpl(MethodImplOptions.InternalCall)] [StaticAccessor(/*Could not decode attribute arguments.*/)] private static extern void SplitIndicesStreamsInternal(object verts, object indices); [MethodImpl(MethodImplOptions.InternalCall)] [StaticAccessor(/*Could not decode attribute arguments.*/)] private static extern void SplitUIVertexStreamsInternal(object verts, object positions, object colors, object uv0S, object uv1S, object uv2S, object uv3S, object normals, object tangents); [MethodImpl(MethodImplOptions.InternalCall)] [StaticAccessor(/*Could not decode attribute arguments.*/)] private static extern void CreateUIVertexStreamInternal(object verts, object positions, object colors, object uv0S, object uv1S, object uv2S, object uv3S, object normals, object tangents, object indices); [MethodImpl(MethodImplOptions.InternalCall)] private extern void SetColor_Injected(ref Color color); [MethodImpl(MethodImplOptions.InternalCall)] private extern void GetColor_Injected(out Color ret); [MethodImpl(MethodImplOptions.InternalCall)] private extern void EnableRectClipping_Injected(ref Rect rect); [MethodImpl(MethodImplOptions.InternalCall)] [SpecialName] private extern void get_clippingSoftness_Injected(out Vector2 ret); [MethodImpl(MethodImplOptions.InternalCall)] [SpecialName] private extern void set_clippingSoftness_Injected(ref Vector2 value); } [NativeHeader("Runtime/Camera/Camera.h")] [StaticAccessor(/*Could not decode attribute arguments.*/)] [NativeHeader("Runtime/Transform/RectTransform.h")] [NativeHeader("Modules/UI/RectTransformUtil.h")] [NativeHeader("Modules/UI/Canvas.h")] public sealed class RectTransformUtility { private static readonly Vector3[] s_Corners = (Vector3[])(object)new Vector3[4]; public static Vector2 PixelAdjustPoint(Vector2 point, Transform elementTransform, Canvas canvas) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) PixelAdjustPoint_Injected(ref point, elementTransform, canvas, out var ret); return ret; } public static Rect PixelAdjustRect(RectTransform rectTransform, Canvas canvas) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) PixelAdjustRect_Injected(rectTransform, canvas, out var ret); return ret; } private static bool PointInRectangle(Vector2 screenPoint, RectTransform rect, Camera cam, Vector4 offset) { return PointInRectangle_Injected(ref screenPoint, rect, cam, ref offset); } private RectTransformUtility() { } public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return RectangleContainsScreenPoint(rect, screenPoint, null); } public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera cam) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) return RectangleContainsScreenPoint(rect, screenPoint, cam, Vector4.zero); } public static bool RectangleContainsScreenPoint(RectTransform rect, Vector2 screenPoint, Camera cam, Vector4 offset) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) return PointInRectangle(screenPoint, rect, cam, offset); } public static bool ScreenPointToWorldPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera cam, out Vector3 worldPoint) { //IL_0002: 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_000c: 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_0013: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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) //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_004e: 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_006a: 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_008c: Unknown result type (might be due to invalid IL or missing references) worldPoint = Vector2.op_Implicit(Vector2.zero); Ray val = ScreenPointToRay(cam, screenPoint); Plane val2 = default(Plane); ((Plane)(ref val2))..ctor(((Transform)rect).rotation * Vector3.back, ((Transform)rect).position); float num = 0f; float num2 = Vector3.Dot(Vector3.Normalize(((Transform)rect).position - ((Ray)(ref val)).origin), ((Plane)(ref val2)).normal); if (num2 != 0f && !((Plane)(ref val2)).Raycast(val, ref num)) { return false; } worldPoint = ((Ray)(ref val)).GetPoint(num); return true; } public static bool ScreenPointToLocalPointInRectangle(RectTransform rect, Vector2 screenPoint, Camera cam, out Vector2 localPoint) { //IL_0002: 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_001d: 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_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) localPoint = Vector2.zero; if (ScreenPointToWorldPointInRectangle(rect, screenPoint, cam, out var worldPoint)) { localPoint = Vector2.op_Implicit(((Transform)rect).InverseTransformPoint(worldPoint)); return true; } return false; } public static Ray ScreenPointToRay(Camera cam, Vector2 screenPos) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_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) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0040: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cam != (Object)null) { return cam.ScreenPointToRay(Vector2.op_Implicit(screenPos)); } Vector3 val = Vector2.op_Implicit(screenPos); val.z -= 100f; return new Ray(val, Vector3.forward); } public static Vector2 WorldToScreenPoint(Camera cam, Vector3 worldPoint) { //IL_0021: 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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_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) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cam == (Object)null) { return new Vector2(worldPoint.x, worldPoint.y); } return Vector2.op_Implicit(cam.WorldToScreenPoint(worldPoint)); } public static Bounds CalculateRelativeRectTransformBounds(Transform root, Transform child) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: 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_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_007f: 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_0088: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) RectTransform[] componentsInChildren = ((Component)child).GetComponentsInChildren(false); if (componentsInChildren.Length != 0) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(float.MaxValue, float.MaxValue, float.MaxValue); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(float.MinValue, float.MinValue, float.MinValue); Matrix4x4 worldToLocalMatrix = root.worldToLocalMatrix; int i = 0; for (int num = componentsInChildren.Length; i < num; i++) { componentsInChildren[i].GetWorldCorners(s_Corners); for (int j = 0; j < 4; j++) { Vector3 val3 = ((Matrix4x4)(ref worldToLocalMatrix)).MultiplyPoint3x4(s_Corners[j]); val = Vector3.Min(val3, val); val2 = Vector3.Max(val3, val2); } } Bounds result = default(Bounds); ((Bounds)(ref result))..ctor(val, Vector3.zero); ((Bounds)(ref result)).Encapsulate(val2); return result; } return new Bounds(Vector3.zero, Vector3.zero); } public static Bounds CalculateRelativeRectTransformBounds(Transform trans) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return CalculateRelativeRectTransformBounds(trans, trans); } public static void FlipLayoutOnAxis(RectTransform rect, int axis, bool keepPositioning, bool recursive) { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0096: 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_00b2: 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_00b9: 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rect == (Object)null) { return; } if (recursive) { for (int i = 0; i < ((Transform)rect).childCount; i++) { Transform child = ((Transform)rect).GetChild(i); RectTransform val = (RectTransform)(object)((child is RectTransform) ? child : null); if ((Object)(object)val != (Object)null) { FlipLayoutOnAxis(val, axis, keepPositioning: false, recursive: true); } } } Vector2 pivot = rect.pivot; ((Vector2)(ref pivot))[axis] = 1f - ((Vector2)(ref pivot))[axis]; rect.pivot = pivot; if (!keepPositioning) { Vector2 anchoredPosition = rect.anchoredPosition; ((Vector2)(ref anchoredPosition))[axis] = 0f - ((Vector2)(ref anchoredPosition))[axis]; rect.anchoredPosition = anchoredPosition; Vector2 anchorMin = rect.anchorMin; Vector2 anchorMax = rect.anchorMax; float num = ((Vector2)(ref anchorMin))[axis]; ((Vector2)(ref anchorMin))[axis] = 1f - ((Vector2)(ref anchorMax))[axis]; ((Vector2)(ref anchorMax))[axis] = 1f - num; rect.anchorMin = anchorMin; rect.anchorMax = anchorMax; } } public static void FlipLayoutAxes(RectTransform rect, bool keepPositioning, bool recursive) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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) if ((Object)(object)rect == (Object)null) { return; } if (recursive) { for (int i = 0; i < ((Transform)rect).childCount; i++) { Transform child = ((Transform)rect).GetChild(i); RectTransform val = (RectTransform)(object)((child is RectTransform) ? child : null); if ((Object)(object)val != (Object)null) { FlipLayoutAxes(val, keepPositioning: false, recursive: true); } } } rect.pivot = GetTransposed(rect.pivot); rect.sizeDelta = GetTransposed(rect.sizeDelta); if (!keepPositioning) { rect.anchoredPosition = GetTransposed(rect.anchoredPosition); rect.anchorMin = GetTransposed(rect.anchorMin); rect.anchorMax = GetTransposed(rect.anchorMax); } } private static Vector2 GetTransposed(Vector2 input) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return new Vector2(input.y, input.x); } [MethodImpl(MethodImplOptions.InternalCall)] private static extern void PixelAdjustPoint_Injected(ref Vector2 point, Transform elementTransform, Canvas canvas, out Vector2 ret); [MethodImpl(MethodImplOptions.InternalCall)] private static extern void PixelAdjustRect_Injected(RectTransform rectTransform, Canvas canvas, out Rect ret); [MethodImpl(MethodImplOptions.InternalCall)] private static extern bool PointInRectangle_Injected(ref Vector2 screenPoint, RectTransform rect, Camera cam, ref Vector4 offset); } public enum RenderMode { ScreenSpaceOverlay, ScreenSpaceCamera, WorldSpace } [Flags] public enum AdditionalCanvasShaderChannels { None = 0, TexCoord1 = 1, TexCoord2 = 2, TexCoord3 = 4, Normal = 8, Tangent = 0x10 } [NativeClass("UI::Canvas")] [NativeHeader("Modules/UI/UIStructs.h")] [NativeHeader("Modules/UI/CanvasManager.h")] [NativeHeader("Modules/UI/Canvas.h")] [RequireComponent(typeof(RectTransform))] public sealed class Canvas : Behaviour { public delegate void WillRenderCanvases(); public extern RenderMode renderMode { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern bool isRootCanvas { [MethodImpl(MethodImplOptions.InternalCall)] get; } public Rect pixelRect { get { //IL_0008: Unknown result type (might be due to invalid IL or missing references) get_pixelRect_Injected(out var ret); return ret; } } public extern float scaleFactor { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern float referencePixelsPerUnit { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern bool overridePixelPerfect { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern bool pixelPerfect { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern float planeDistance { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int renderOrder { [MethodImpl(MethodImplOptions.InternalCall)] get; } public extern bool overrideSorting { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int sortingOrder { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int targetDisplay { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int sortingLayerID { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern int cachedSortingLayerValue { [MethodImpl(MethodImplOptions.InternalCall)] get; } public extern AdditionalCanvasShaderChannels additionalShaderChannels { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern string sortingLayerName { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public extern Canvas rootCanvas { [MethodImpl(MethodImplOptions.InternalCall)] get; } public Vector2 renderingDisplaySize { get { //IL_0008: Unknown result type (might be due to invalid IL or missing references) get_renderingDisplaySize_Injected(out var ret); return ret; } } internal static Action externBeginRenderOverlays { get; set; } internal static Action externRenderOverlaysBefore { get; set; } internal static Action externEndRenderOverlays { get; set; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern Camera worldCamera { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } [NativeProperty(/*Could not decode attribute arguments.*/)] public extern float normalizedSortingGridSize { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } [NativeProperty(/*Could not decode attribute arguments.*/)] [Obsolete("Setting normalizedSize via a int is not supported. Please use normalizedSortingGridSize", false)] public extern int sortingGridNormalizedSize { [MethodImpl(MethodImplOptions.InternalCall)] get; [MethodImpl(MethodImplOptions.InternalCall)] set; } public static event WillRenderCanvases preWillRenderCanvases; public static event WillRenderCanvases willRenderCanvases; [MethodImpl(MethodImplOptions.InternalCall)] [FreeFunction("UI::CanvasManager::SetExternalCanvasEnabled")] internal static extern void SetExternalCanvasEnabled(bool enabled); [MethodImpl(MethodImplOptions.InternalCall)] [FreeFunction("UI::GetDefaultUIMaterial")] [Obsolete("Shared default material now used for text and general UI elements, call Canvas.GetDefaultCanvasMaterial()", false)] public static extern Material GetDefaultCanvasTextMaterial(); [MethodImpl(MethodImplOptions.InternalCall)] [FreeFunction("UI::GetDefaultUIMaterial")] public static extern Material GetDefaultCanvasMaterial(); [MethodImpl(MethodImplOptions.InternalCall)] [FreeFunction("UI::GetETC1SupportedCanvasMaterial")] public static extern Material GetETC1SupportedCanvasMaterial(); [MethodImpl(MethodImplOptions.InternalCall)] internal extern void UpdateCanvasRectTransform(bool alignWithCamera); public static void ForceUpdateCanvases() { SendPreWillRenderCanvases(); SendWillRenderCanvases(); } [RequiredByNativeCode] private static void SendPreWillRenderCanvases() { Canvas.preWillRenderCanvases?.Invoke(); } [RequiredByNativeCode] private static void SendWillRenderCanvases() { Canvas.willRenderCanvases?.Invoke(); } [RequiredByNativeCode] private static void BeginRenderExtraOverlays(int displayIndex) { externBeginRenderOverlays?.Invoke(displayIndex); } [RequiredByNativeCode] private static void RenderExtraOverlaysBefore(int displayIndex, int sortingOrder) { externRenderOverlaysBefore?.Invoke(displayIndex, sortingOrder); } [RequiredByNativeCode] private static void EndRenderExtraOverlays(int displayIndex) { externEndRenderOverlays?.Invoke(displayIndex); } [MethodImpl(MethodImplOptions.InternalCall)] [SpecialName] private extern void get_pixelRect_Injected(out Rect ret); [MethodImpl(MethodImplOptions.InternalCall)] [SpecialName] private extern void get_renderingDisplaySize_Injected(out Vector2 ret); } [StaticAccessor(/*Could not decode attribute arguments.*/)] [NativeHeader("Modules/UI/Canvas.h")] public static class UISystemProfilerApi { public enum SampleType { Layout, Render } [MethodImpl(MethodImplOptions.InternalCall)] public static extern void BeginSample(SampleType type); [MethodImpl(MethodImplOptions.InternalCall)] public static extern void EndSample(SampleType type); [MethodImpl(MethodImplOptions.InternalCall)] public static extern void AddMarker(string name, Object obj); }