diff --git a/Data/ApiDatabase.json b/Data/ApiDatabase.json
index 4a331d6cf0..64da538f23 100644
--- a/Data/ApiDatabase.json
+++ b/Data/ApiDatabase.json
@@ -1,1494 +1,1492 @@
-{
- "Items": [
- {
- "id": "PAC0000",
- "type": "UnityEngine.Camera",
- "method": "main",
- "areas": ["CPU"],
- "description": "Camera.main property uses FindGameObjectsWithTag() internally and doesn't cache the result.",
- "solution": "It is advised to cache and use the camera component obtained from Game object instead.",
- "maximumVersion": "2019.4.8"
- },
- {
- "id": "PAC0001",
- "type": "UnityEngine.WebCamTexture",
- "method": "GetPixels",
- "areas": ["Memory"],
- "description": "WebCamTexture.GetPixels() allocates managed memory.",
- "solution": "Use WebCamTexture.GetPixels32() instead."
- },
- {
- "id": "PAC0002",
- "type": "UnityEngine.WebCamTexture",
- "method": "GetPixels32",
- "areas": ["Memory"],
- "description": "WebCamTexture.GetPixels32() allocates managed memory if a suitable array is not provided as a parameter.",
- "solution": "Ensure that you pass an array of Color32[] to this API method for it to fill out, to avoid creating a new array every time the method is called."
- },
- {
- "id": "PAC0003",
- "type": "UnityEngine.GeometryUtility",
- "method": "CalculateFrustumPlanes",
- "areas": ["Memory"],
- "description": "Some versions of GeometryUtility.CalculateFrustumPlanes() allocate managed memory.",
- "solution": "Ensure that you use the CalculateFrustumPlanes(Matrix4x4 worldToProjectionMatrix, Plane[] planes) version of this API method, in order to be able to pass a pre-allocated Array of Planes."
- },
- {
- "id": "PAC0004",
- "type": "UnityEngine.Resources",
- "method": "FindObjectsOfTypeAll",
- "areas": ["Memory"],
- "description": "Resources.FindObjectsOfTypeAll() allocates managed memory.",
- "solution": "Use Resources.FindObjectsOfTypeNonAlloc() instead."
- },
- {
- "id": "PAC0005",
- "type": "UnityEngine.Texture2D",
- "method": "GetPixels",
- "areas": ["Memory"],
- "description": "Texture2D.GetPixels() allocates managed memory.",
- "solution": "Use Texture2D.GetRawTextureData() instead. This method returns a NativeArray of pixel data, and so does not allocate managed memory."
- },
- {
- "id": "PAC0006",
- "type": "UnityEngine.Texture2D",
- "method": "GetPixels32",
- "areas": ["Memory"],
- "description": "Texture2D.GetPixels32() allocates managed memory.",
- "solution": "Use Texture2D.GetRawTextureData() instead. This method returns a NativeArray of pixel data, and so does not allocate managed memory."
- },
- {
- "id": "PAC0007",
- "type": "UnityEngine.Rigidbody",
- "method": "SweepTestAll",
- "areas": ["Memory"],
- "description": "Rigidbody.SweepTestAll() allocates managed memory.",
- "solution": "Use Rigidbody.SweepTestNonAlloc() instead."
- },
- {
- "id": "PAC0008",
- "type": "UnityEngine.Physics",
- "method": "RaycastAll",
- "areas": ["Memory"],
- "description": "Physics.RaycastAll() allocates managed memory.",
- "solution": "Use Physics.RaycastNonAlloc() instead."
- },
- {
- "id": "PAC0009",
- "type": "UnityEngine.Physics",
- "method": "CapsuleCastAll",
- "areas": ["Memory"],
- "description": "Physics.CapsuleCastAll() allocates managed memory.",
- "solution": "Use Physics.CapsuleCastNonAlloc() instead."
- },
- {
- "id": "PAC0010",
- "type": "UnityEngine.Physics",
- "method": "SphereCastAll",
- "areas": ["Memory"],
- "description": "Physics.SphereCastAll() allocates managed memory.",
- "solution": "Use Physics.SphereCastNonAlloc() instead."
- },
- {
- "id": "PAC0011",
- "type": "UnityEngine.Physics",
- "method": "BoxCastAll",
- "areas": ["Memory"],
- "description": "Physics.BoxCastAll() allocates managed memory.",
- "solution": "Use Physics.BoxCastNonAlloc() instead."
- },
- {
- "id": "PAC0012",
- "type": "UnityEngine.Physics",
- "method": "OverlapCapsule",
- "areas": ["Memory"],
- "description": "Physics.OverlapCapsule() allocates managed memory.",
- "solution": "Use Physics.OverlapCapsuleNonAlloc() instead."
- },
- {
- "id": "PAC0013",
- "type": "UnityEngine.Physics",
- "method": "OverlapSphere",
- "areas": ["Memory"],
- "description": "Physics.OverlapSphere() allocates managed memory.",
- "solution": "Use Physics.OverlapSphereNonAlloc() instead."
- },
- {
- "id": "PAC0014",
- "type": "UnityEngine.Physics",
- "method": "OverlapBox",
- "areas": ["Memory"],
- "description": "Physics.OverlapBox() allocates managed memory.",
- "solution": "Use Physics.OverlapBoxNonAlloc() instead."
- },
- {
- "id": "PAC0015",
- "type": "UnityEngine.Physics2D",
- "method": "LinecastAll",
- "areas": ["Memory"],
- "description": "Physics2D.LinecastAll() allocates managed memory.",
- "solution": "Use Physics2D.LinecastNonAlloc() instead."
- },
- {
- "id": "PAC0016",
- "type": "UnityEngine.Physics2D",
- "method": "RaycastAll",
- "areas": ["Memory"],
- "description": "Physics2D.RaycastAll() allocates managed memory.",
- "solution": "Use Physics2D.RaycastNonAlloc() instead."
- },
- {
- "id": "PAC0017",
- "type": "UnityEngine.Physics2D",
- "method": "CircleCastAll",
- "areas": ["Memory"],
- "description": "Physics2D.CircleCastAll() allocates managed memory.",
- "solution": "Use Physics2D.CircleCastNonAlloc() instead."
- },
- {
- "id": "PAC0018",
- "type": "UnityEngine.Physics2D",
- "method": "BoxCastAll",
- "areas": ["Memory"],
- "description": "Physics2D.BoxCastAll() allocates managed memory.",
- "solution": "Use Physics2D.BoxCastNonAlloc() instead."
- },
- {
- "id": "PAC0019",
- "type": "UnityEngine.Physics2D",
- "method": "CapsuleCastAll",
- "areas": ["Memory"],
- "description": "Physics2D.CapsuleCastAll() allocates managed memory.",
- "solution": "Use Physics2D.CapsuleCastNonAlloc() instead."
- },
- {
- "id": "PAC0020",
- "type": "UnityEngine.Physics2D",
- "method": "GetRayIntersectionAll",
- "areas": ["Memory"],
- "description": "Physics2D.GetRayIntersectionAll() allocates managed memory.",
- "solution": "Use Physics2D.GetRayIntersectionNonAlloc() instead."
- },
- {
- "id": "PAC0021",
- "type": "UnityEngine.Physics2D",
- "method": "OverlapPointAll",
- "areas": ["Memory"],
- "description": "Physics2D.OverlapPointAll() allocates managed memory.",
- "solution": "Use Physics2D.OverlapPointNonAlloc() instead."
- },
- {
- "id": "PAC0022",
- "type": "UnityEngine.Physics2D",
- "method": "OverlapCircleAll",
- "areas": ["Memory"],
- "description": "Physics2D.OverlapCircleAll() allocates managed memory.",
- "solution": "Use Physics2D.OverlapCircleNonAlloc() instead."
- },
- {
- "id": "PAC0023",
- "type": "UnityEngine.Physics2D",
- "method": "OverlapBoxAll",
- "areas": ["Memory"],
- "description": "Physics2D.OverlapBoxAll() allocates managed memory.",
- "solution": "Use Physics2D.OverlapBoxNonAlloc() instead."
- },
- {
- "id": "PAC0024",
- "type": "UnityEngine.Physics2D",
- "method": "OverlapAreaAll",
- "areas": ["Memory"],
- "description": "Physics2D.OverlapAreaAll() allocates managed memory.",
- "solution": "Use Physics2D.OverlapAreaNonAlloc() instead."
- },
- {
- "id": "PAC0025",
- "type": "UnityEngine.Physics2D",
- "method": "OverlapCapsuleAll",
- "areas": ["Memory"],
- "description": "Physics2D.OverlapCapsuleAll() allocates managed memory.",
- "solution": "Use Physics2D.OverlapCapsuleNonAlloc() instead."
- },
- {
- "id": "PAC0026",
- "type": "UnityEngine.Component",
- "method": "GetComponentsInChildren",
- "areas": ["Memory"],
- "description": "Component.GetComponentsInChildren() allocates managed memory.",
- "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInChildren() which accepts a List as a parameter and populates it with the components it finds."
- },
- {
- "id": "PAC0027",
- "type": "UnityEngine.Component",
- "method": "GetComponentsInParent",
- "areas": ["Memory"],
- "description": "Component.GetComponentsInParent() allocates managed memory.",
- "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInParent() which accepts a List as a parameter and populates it with the components it finds."
- },
- {
- "id": "PAC0028",
- "type": "UnityEngine.GameObject",
- "method": "GetComponentsInChildren",
- "areas": ["Memory"],
- "description": "Some versions of GameObject.GetComponentsInChildren() allocate managed memory.",
- "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInChildren() which accepts a List as a parameter and populates it with the components it finds."
- },
- {
- "id": "PAC0029",
- "type": "UnityEngine.GameObject",
- "method": "GetComponentsInParent",
- "areas": ["Memory"],
- "description": "Some versions of GameObject.GetComponentsInParent() allocate managed memory.",
- "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInParent() which accepts a List as a parameter and populates it with the components it finds."
- },
- {
- "id": "PAC0030",
- "type": "UnityEngine.Collider",
- "method": "OnTriggerStay",
- "areas": ["CPU"],
- "description": "OnTriggerStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many Colliders which implement this method.",
- "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay() methods, and consider refactoring code to not use them."
- },
- {
- "id": "PAC0031",
- "type": "UnityEngine.MonoBehaviour",
- "method": "OnTriggerStay",
- "areas": ["CPU"],
- "description": "OnTriggerStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many MonoBehaviours which implement this method.",
- "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay() methods, and consider refactoring code to not use them."
- },
- {
- "id": "PAC0032",
- "type": "UnityEngine.Collider2D",
- "method": "OnTriggerStay2D",
- "areas": ["CPU"],
- "description": "OnTriggerStay2D() methods can detrimentally affect performance if they perform a lot of processing or if there are many Collider2Ds which implement this method.",
- "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay2D() methods, and consider refactoring code to not use them."
- },
- {
- "id": "PAC0033",
- "type": "UnityEngine.MonoBehaviour",
- "method": "OnTriggerStay2D",
- "areas": ["CPU"],
- "description": "OnTriggerStay2D() methods can detrimentally affect performance if they perform a lot of processing or if there are many MonoBehaviours which implement this method.",
- "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay2D() methods, and consider refactoring code to not use them."
- },
- {
- "id": "PAC0034",
- "type": "UnityEngine.Collider",
- "method": "OnCollisionStay",
- "areas": ["CPU"],
- "description": "OnCollisionStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many Colliders which implement this method.",
- "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnCollisionStay() methods, and consider refactoring code to not use them."
- },
- {
- "id": "PAC0035",
- "type": "UnityEngine.MonoBehaviour",
- "method": "OnCollisionStay",
- "areas": ["CPU"],
- "description": "OnCollisionStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many MonoBehaviours which implement this method.",
- "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnCollisionStay() methods, and consider refactoring code to not use them."
- },
- {
- "id": "PAC0036",
- "type": "UnityEngine.Rigidbody",
- "method": "OnCollisionStay",
- "areas": ["CPU"],
- "description": "OnCollisionStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many RigidBodies which implement this method.",
- "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnCollisionStay() methods, and consider refactoring code to not use them."
- },
- {
- "id": "PAC0037",
- "type": "UnityEngine.ImageConversion",
- "method": "LoadImage",
- "areas": ["Memory"],
- "description": "ImageConversion.LoadImage() defaults to maintaining a CPU-accessible copy of the image. This is a waste of memory if not needed.",
- "solution": "If a CPU-accessible copy of the texture is not required, ensure that the markNonReadable flag passed into the method is set to true."
- },
- {
- "id": "PAC0039",
- "type": "UnityEngine.Renderer",
- "method": "material",
- "areas": ["GPU"],
- "description": "The Renderer.material property creates a unique copy of the Renderer's material. This breaks draw call batching and results in a higher number of draw calls, impacting rendering performance.",
- "solution": "If possible, use Renderer.sharedMaterial instead."
- },
- {
- "id": "PAC0051",
- "type": "UnityEngine.ComputeBuffer",
- "method": "GetData",
- "areas": ["CPU"],
- "description": "ComputeBuffer.GetData() stalls the CPU until the GPU has finished accessing the buffer. This can lead to significant CPU performance problems.",
- "solution": "Avoid reading back from ComputeBuffers if it is at all possible. If it's unavoidable, profile your project carefully and regularly to monitor the performance impact."
- },
- {
- "id": "PAC0052",
- "type": "UnityEngine.Texture2D",
- "method": "SetPixels",
- "areas": ["CPU"],
- "description": "Texture2D.SetPixels() is slower than Texture2D.SetPixels32().",
- "solution": "Use Texture2D.SetPixels32(), Texture2D.GetRawTextureData(), or Texture2D.Apply() instead."
- },
- {
- "id": "PAC0053",
- "type": "UnityEngine.Texture3D",
- "method": "SetPixels",
- "areas": ["CPU"],
- "description": "Texture3D.SetPixels() is slower than Texture3D.SetPixels32().",
- "solution": "Use Texture3D.SetPixels32() instead."
- },
- {
- "id": "PAC0054",
- "type": "UnityEngine.Texture2DArray",
- "method": "SetPixels",
- "areas": ["CPU"],
- "description": "Texture2DArray.SetPixels() is slower than Texture2DArray.SetPixels32().",
- "solution": "Use Texture2DArray.SetPixels32() instead."
- },
- {
- "id": "PAC0055",
- "type": "UnityEngine.CubemapArray",
- "method": "SetPixels",
- "areas": ["CPU"],
- "description": "CubemapArray.SetPixels() is slower than CubemapArray.SetPixels32().",
- "solution": "Use CubemapArray.SetPixels32() instead."
- },
- {
- "id": "PAC0056",
- "type": "UnityEngine.GameObject",
- "method": "SendMessage",
- "areas": ["CPU"],
- "description": "GameObject.SendMessage() is a very slow and CPU-intensive method.",
- "solution": "Implement a custom system to replace SendMessage - get the components you want to send messages to and call methods directly on them."
- },
- {
- "id": "PAC0057",
- "type": "UnityEngine.Component",
- "method": "SendMessage",
- "areas": ["CPU"],
- "description": "Component.SendMessage() is a very slow and CPU-intensive method.",
- "solution": "Implement a custom system to replace SendMessage - get the components you want to send messages to and call methods directly on them."
- },
- {
- "id": "PAC0058",
- "type": "UnityEngine.MonoBehaviour",
- "method": "OnGUI",
- "areas": ["CPU"],
- "description": "OnGUI() is used by the legacy Immediate Mode GUI (IMGUI), which is extremely CPU-intensive. If a single OnGUI() method is present in a project's code, IMGUI will initialize and consume CPU time.",
- "solution": "Remove all OnGUI() methods from the project code."
- },
- {
- "id": "PAC0059",
- "type": "UnityEngine.AI.NavMeshPath",
- "method": "corners",
- "areas": ["Memory"],
- "description": "The property AI.NavMeshPath.corners allocates managed memory.",
- "solution": "Use AI.NavMeshPath.GetCornersNonAlloc() instead."
- },
- {
- "id": "PAC0060",
- "type": "UnityEngine.Animator",
- "method": "parameters",
- "areas": ["Memory"],
- "description": "The property Animator.parameters allocates managed memory.",
- "solution": "Use Animator.GetParameter() instead."
- },
- {
- "id": "PAC0061",
- "type": "UnityEngine.Animations.ParentConstraint",
- "method": "translationOffsets",
- "areas": ["Memory"],
- "description": "The property Animations.ParentConstraint.translationOffsets allocates managed memory.",
- "solution": "Use Animations.ParentConstraint.GetTranslationOffset() instead."
- },
- {
- "id": "PAC0062",
- "type": "UnityEngine.Animations.ParentConstraint",
- "method": "rotationOffsets",
- "areas": ["Memory"],
- "description": "The property Animations.ParentConstraint.rotationOffsets allocates managed memory.",
- "solution": "Use Animations.ParentConstraint.GetRotationOffset() instead."
- },
- {
- "id": "PAC0063",
- "type": "UnityEngine.AnimationCurve",
- "method": "keys",
- "areas": ["Memory"],
- "description": "The property AnimationCurve.keys allocates managed memory.",
- "solution": "Use AnimationCurve.AddKey(), AnimationCurve.MoveKey() or AnimationCurve.RemoveKey() instead."
- },
- {
- "id": "PAC0066",
- "type": "UnityEngine.Camera",
- "method": "allCameras",
- "areas": ["Memory"],
- "description": "The property Camera.allCameras allocates managed memory.",
- "solution": "Use Camera.GetAllCameras() instead."
- },
- {
- "id": "PAC0067",
- "type": "UnityEngine.Mesh",
- "method": "boneWeights",
- "areas": ["Memory"],
- "description": "The property Mesh.boneWeights allocates managed memory.",
- "solution": "Use Mesh.GetAllBoneWeights() instead. This method returns a NativeArray of BoneWeight1, and so does not allocate managed memory."
- },
- {
- "id": "PAC0068",
- "type": "UnityEngine.Mesh",
- "method": "bindposes",
- "areas": ["Memory"],
- "description": "The property Mesh.bindposes allocates managed memory.",
- "solution": "Use Mesh.GetBindposes() instead."
- },
- {
- "id": "PAC0069",
- "type": "UnityEngine.Mesh",
- "method": "vertices",
- "areas": ["Memory"],
- "description": "The property Mesh.vertices allocates managed memory.",
- "solution": "Use Mesh.GetVertices() instead."
- },
- {
- "id": "PAC0070",
- "type": "UnityEngine.Mesh",
- "method": "normals",
- "areas": ["Memory"],
- "description": "The property Mesh.normals allocates managed memory.",
- "solution": "Use Mesh.GetNormals() instead."
- },
- {
- "id": "PAC0071",
- "type": "UnityEngine.Mesh",
- "method": "tangents",
- "areas": ["Memory"],
- "description": "The property Mesh.tangents allocates managed memory.",
- "solution": "Use Mesh.GetTangents() instead."
- },
- {
- "id": "PAC0072",
- "type": "UnityEngine.Mesh",
- "method": "uv",
- "areas": ["Memory"],
- "description": "The property Mesh.uv allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0073",
- "type": "UnityEngine.Mesh",
- "method": "uv1",
- "areas": ["Memory"],
- "description": "The property Mesh.uv1 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0074",
- "type": "UnityEngine.Mesh",
- "method": "uv2",
- "areas": ["Memory"],
- "description": "The property Mesh.uv2 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0075",
- "type": "UnityEngine.Mesh",
- "method": "uv3",
- "areas": ["Memory"],
- "description": "The property Mesh.uv3 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0076",
- "type": "UnityEngine.Mesh",
- "method": "uv4",
- "areas": ["Memory"],
- "description": "The property Mesh.uv4 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0077",
- "type": "UnityEngine.Mesh",
- "method": "uv5",
- "areas": ["Memory"],
- "description": "The property Mesh.uv5 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0078",
- "type": "UnityEngine.Mesh",
- "method": "uv6",
- "areas": ["Memory"],
- "description": "The property Mesh.uv6 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0079",
- "type": "UnityEngine.Mesh",
- "method": "uv7",
- "areas": ["Memory"],
- "description": "The property Mesh.uv7 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0080",
- "type": "UnityEngine.Mesh",
- "method": "uv8",
- "areas": ["Memory"],
- "description": "The property Mesh.uv8 allocates managed memory.",
- "solution": "Use Mesh.GetUVs() instead."
- },
- {
- "id": "PAC0081",
- "type": "UnityEngine.Mesh",
- "method": "colors",
- "areas": ["Memory"],
- "description": "The property Mesh.colors allocates managed memory.",
- "solution": "Use Mesh.GetColors() instead."
- },
- {
- "id": "PAC0082",
- "type": "UnityEngine.Mesh",
- "method": "colors32",
- "areas": ["Memory"],
- "description": "The property Mesh.colors32 allocates managed memory.",
- "solution": "Use Mesh.GetColors() instead."
- },
- {
- "id": "PAC0083",
- "type": "UnityEngine.Mesh",
- "method": "triangles",
- "areas": ["Memory"],
- "description": "The property Mesh.triangles allocates managed memory.",
- "solution": "Use Mesh.GetTriangles() instead."
- },
- {
- "id": "PAC0084",
- "type": "UnityEngine.Renderer",
- "method": "materials",
- "areas": ["Memory"],
- "description": "The property Renderer.materials allocates managed memory.",
- "solution": "Use Renderer.GetMaterials() instead."
- },
- {
- "id": "PAC0085",
- "type": "UnityEngine.Renderer",
- "method": "sharedMaterials",
- "areas": ["Memory"],
- "description": "The property Renderer.sharedMaterials allocates managed memory.",
- "solution": "Use Renderer.GetSharedMaterials() instead."
- },
- {
- "id": "PAC0094",
- "type": "UnityEngine.Input",
- "method": "touches",
- "areas": ["Memory"],
- "description": "The property Input.touches allocates managed memory.",
- "solution": "Use Input.GetTouch() instead."
- },
- {
- "id": "PAC0095",
- "type": "UnityEngine.Input",
- "method": "accelerationEvents",
- "areas": ["Memory"],
- "description": "The property Input.accelerationEvents allocates managed memory.",
- "solution": "Use Input.GetAccelerationEvent() instead."
- },
- {
- "id": "PAC0096",
- "type": "UnityEngine.iOS.NotificationServices",
- "method": "localNotifications",
- "areas": ["Memory"],
- "description": "The property iOS.NotificationServices.localNotifications allocates managed memory.",
- "solution": "Use iOS.NotificationServices.GetLocalNotification() instead.",
- "maximumVersion": "2021.3",
- "platforms": ["iOS"]
- },
- {
- "id": "PAC0097",
- "type": "UnityEngine.iOS.NotificationServices",
- "method": "remoteNotifications",
- "areas": ["Memory"],
- "description": "The property iOS.NotificationServices.remoteNotifications allocates managed memory.",
- "solution": "Use iOS.NotificationServices.GetRemoteNotification() instead.",
- "maximumVersion": "2021.3",
- "platforms": ["iOS"]
- },
- {
- "id": "PAC0100",
- "type": "UnityEngine.GUISkin",
- "method": "customStyles",
- "areas": ["Memory"],
- "description": "The property GUISkin.customStyles allocates managed memory.",
- "solution": "Use GUISkin.GetStyle() or GUISkin.FindStyle() instead."
- },
- {
- "id": "PAC0103",
- "type": "UnityEngine.Collision",
- "method": "contacts",
- "areas": ["Memory"],
- "description": "The property Collision.contacts allocates managed memory.",
- "solution": "Use Collision.GetContacts() instead."
- },
- {
- "id": "PAC0104",
- "type": "UnityEngine.Collision2D",
- "method": "contacts",
- "areas": ["Memory"],
- "description": "The property Collision2D.contacts allocates managed memory.",
- "solution": "Use Collision2D.GetContacts() instead."
- },
- {
- "id": "PAC0110",
- "type": "UnityEngine.TerrainData",
- "method": "treeInstances",
- "areas": ["Memory"],
- "description": "The property TerrainData.treeInstances allocates managed memory.",
- "solution": "Use TerrainData.GetTreeInstance() instead."
- },
- {
- "id": "PAC0111",
- "type": "UnityEngine.TerrainData",
- "method": "alphamapTextures",
- "areas": ["Memory"],
- "description": "The property TerrainData.alphamapTextures allocates managed memory.",
- "solution": "Use TerrainData.GetAlphamapTexture() instead."
- },
- {
- "id": "PAC0112",
- "type": "UnityEngine.Font",
- "method": "characterInfo",
- "areas": ["Memory"],
- "description": "The property Font.characterInfo allocates managed memory.",
- "solution": "Use Font.GetCharacterInfo() instead."
- },
- {
- "id": "PAC0115",
- "type": "UnityEngine.Animator",
- "method": "GetCurrentAnimatorClipInfo",
- "areas": ["Memory"],
- "description": "Animator.GetCurrentAnimatorClipInfo() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0116",
- "type": "UnityEngine.Animator",
- "method": "GetBehaviours",
- "areas": ["Memory"],
- "description": "Animator.GetBehaviours() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0117",
- "type": "UnityEngine.AssetBundle",
- "method": "LoadAssetWithSubAssets",
- "areas": ["Memory"],
- "description": "AssetBundle.LoadAssetWithSubAssets() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0118",
- "type": "UnityEngine.AssetBundle",
- "method": "LoadAllAssets",
- "areas": ["Memory"],
- "description": "AssetBundle.LoadAllAssets() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0119",
- "type": "UnityEngine.AssetBundleManifest",
- "method": "GetAllAssetBundles",
- "areas": ["Memory"],
- "description": "AssetBundleManifest.GetAllAssetBundles() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0120",
- "type": "UnityEngine.Resources",
- "method": "LoadAll",
- "areas": ["Memory"],
- "description": "Resources.LoadAll() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0121",
- "type": "UnityEngine.Texture2D",
- "method": "PackTextures",
- "areas": ["Memory"],
- "description": "Texture2D.PackTextures() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0122",
- "type": "UnityEngine.Cubemap",
- "method": "GetPixels",
- "areas": ["Memory"],
- "description": "Cubemap.GetPixels() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0123",
- "type": "UnityEngine.Texture3D",
- "method": "GetPixels",
- "areas": ["Memory"],
- "description": "Texture3D.GetPixels() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0124",
- "type": "UnityEngine.Texture3D",
- "method": "GetPixels32",
- "areas": ["Memory"],
- "description": "Texture3D.GetPixels32() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0125",
- "type": "UnityEngine.Texture2DArray",
- "method": "GetPixels",
- "areas": ["Memory"],
- "description": "Texture2DArray.GetPixels() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0126",
- "type": "UnityEngine.Texture2DArray",
- "method": "GetPixels32",
- "areas": ["Memory"],
- "description": "Texture2DArray.GetPixels32() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0127",
- "type": "UnityEngine.CubemapArray",
- "method": "GetPixels",
- "areas": ["Memory"],
- "description": "CubemapArray.GetPixels() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0128",
- "type": "UnityEngine.CubemapArray",
- "method": "GetPixels32",
- "areas": ["Memory"],
- "description": "CubemapArray.GetPixels32() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0129",
- "type": "UnityEngine.Object",
- "method": "FindObjectsOfType",
- "areas": ["CPU", "Memory"],
- "description": "Object.FindObjectsOfType() allocates managed memory and can be slow.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0130",
- "type": "UnityEngine.Windows.Crypto",
- "method": "ComputeMD5Hash",
- "areas": ["Memory"],
- "description": "Windows.Crypto.ComputeMD5Hash() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0131",
- "type": "UnityEngine.Windows.File",
- "method": "ReadAllBytes",
- "areas": ["Memory"],
- "description": "Windows.File.ReadAllBytes() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0132",
- "type": "UnityEngine.ImageConversion",
- "method": "EncodeToJPG",
- "areas": ["Memory"],
- "description": "ImageConversion.EncodeToJPG() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0133",
- "type": "UnityEngine.ImageConversion",
- "method": "EncodeToEXR",
- "areas": ["Memory"],
- "description": "ImageConversion.EncodeToEXR() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0134",
- "type": "UnityEngine.ImageConversion",
- "method": "EncodeToTGA",
- "areas": ["Memory"],
- "description": "ImageConversion.EncodeToTGA() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0135",
- "type": "UnityEngine.ImageConversion",
- "method": "EncodeToPNG",
- "areas": ["Memory"],
- "description": "ImageConversion.EncodeToPNG() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0136",
- "type": "UnityEngine.U2D.SpriteShapeUtility",
- "method": "Generate",
- "areas": ["Memory"],
- "description": "U2D.SpriteShapeUtility.Generate() allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "minimumVersion": "2019.3"
- },
- {
- "id": "PAC0138",
- "type": "UnityEngine.AI.NavMeshTriangulation",
- "method": "layers",
- "areas": ["Memory"],
- "description": "The property AI.NavMeshTriangulation.layers allocates managed memory.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0139",
- "type": "UnityEngine.AnimationClip",
- "method": "events",
- "areas": ["Memory"],
- "description": "The property AnimationClip.events allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0140",
- "type": "UnityEngine.AnimatorOverrideController",
- "method": "animationClips",
- "areas": ["Memory"],
- "description": "The property AnimatorOverrideController.animationClips allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0141",
- "type": "UnityEngine.HumanTrait",
- "method": "MuscleName",
- "areas": ["Memory"],
- "description": "The property HumanTrait.MuscleName allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0142",
- "type": "UnityEngine.HumanTrait",
- "method": "BoneName",
- "areas": ["Memory"],
- "description": "The property HumanTrait.BoneName allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0143",
- "type": "UnityEngine.RuntimeAnimatorController",
- "method": "animationClips",
- "areas": ["Memory"],
- "description": "The property RuntimeAnimatorController.animationClips allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0144",
- "type": "UnityEngine.AssetBundleRequest",
- "method": "allAssets",
- "areas": ["Memory"],
- "description": "The property AssetBundleRequest.allAssets allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0145",
- "type": "UnityEngine.Microphone",
- "method": "devices",
- "areas": ["Memory"],
- "description": "The property Microphone.devices allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0146",
- "type": "UnityEngine.WebCamDevice",
- "method": "availableResolutions",
- "areas": ["Memory"],
- "description": "The property WebCamDevice.availableResolutions allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0147",
- "type": "UnityEngine.WebCamTexture",
- "method": "devices",
- "areas": ["Memory"],
- "description": "The property WebCamTexture.devices allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0148",
- "type": "UnityEngine.Cloth",
- "method": "vertices",
- "areas": ["Memory"],
- "description": "The property Cloth.vertices allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0149",
- "type": "UnityEngine.Cloth",
- "method": "normals",
- "areas": ["Memory"],
- "description": "The property Cloth.normals allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0150",
- "type": "UnityEngine.Cloth",
- "method": "coefficients",
- "areas": ["Memory"],
- "description": "The property Cloth.coefficients allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0151",
- "type": "UnityEngine.Cloth",
- "method": "capsuleColliders",
- "areas": ["Memory"],
- "description": "The property Cloth.capsuleColliders allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0152",
- "type": "UnityEngine.Cloth",
- "method": "sphereColliders",
- "areas": ["Memory"],
- "description": "The property Cloth.sphereColliders allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0153",
- "type": "UnityEngine.Camera",
- "method": "layerCullDistances",
- "areas": ["Memory"],
- "description": "The property Camera.layerCullDistances allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0154",
- "type": "UnityEngine.CrashReport",
- "method": "reports",
- "areas": ["Memory"],
- "description": "The property CrashReport.reports allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0155",
- "type": "UnityEngine.Gradient",
- "method": "colorKeys",
- "areas": ["Memory"],
- "description": "The property Gradient.colorKeys allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0156",
- "type": "UnityEngine.Gradient",
- "method": "alphaKeys",
- "areas": ["Memory"],
- "description": "The property Gradient.alphaKeys allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0157",
- "type": "UnityEngine.Screen",
- "method": "resolutions",
- "areas": ["Memory"],
- "description": "The property Screen.resolutions allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0158",
- "type": "UnityEngine.LightmapSettings",
- "method": "lightmaps",
- "areas": ["Memory"],
- "description": "The property LightmapSettings.lightmaps allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0159",
- "type": "UnityEngine.LightProbes",
- "method": "positions",
- "areas": ["Memory"],
- "description": "The property LightProbes.positions allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0160",
- "type": "UnityEngine.LightProbes",
- "method": "bakedProbes",
- "areas": ["Memory"],
- "description": "The property LightProbes.bakedProbes allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0161",
- "type": "UnityEngine.LightProbes",
- "method": "coefficients",
- "areas": ["Memory"],
- "description": "The property LightProbes.coefficients allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0162",
- "type": "UnityEngine.QualitySettings",
- "method": "names",
- "areas": ["Memory"],
- "description": "The property QualitySettings.names allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0163",
- "type": "UnityEngine.Material",
- "method": "shaderKeywords",
- "areas": ["Memory"],
- "description": "The property Material.shaderKeywords allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0164",
- "type": "UnityEngine.Light",
- "method": "layerShadowCullDistances",
- "areas": ["Memory"],
- "description": "The property Light.layerShadowCullDistances allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0165",
- "type": "UnityEngine.Rendering.RenderTargetBinding",
- "method": "colorRenderTargets",
- "areas": ["Memory"],
- "description": "The property Rendering.RenderTargetBinding.colorRenderTargets allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0166",
- "type": "UnityEngine.Rendering.RenderTargetBinding",
- "method": "colorLoadActions",
- "areas": ["Memory"],
- "description": "The property Rendering.RenderTargetBinding.colorLoadActions allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0167",
- "type": "UnityEngine.Rendering.RenderTargetBinding",
- "method": "colorStoreActions",
- "areas": ["Memory"],
- "description": "The property Rendering.RenderTargetBinding.colorStoreActions allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0168",
- "type": "UnityEngine.SkinnedMeshRenderer",
- "method": "bones",
- "areas": ["Memory"],
- "description": "The property SkinnedMeshRenderer.bones allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0169",
- "type": "UnityEngine.LightProbeGroup",
- "method": "probePositions",
- "areas": ["Memory"],
- "description": "The property LightProbeGroup.probePositions allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0170",
- "type": "UnityEngine.Network",
- "method": "connections",
- "areas": ["Memory"],
- "description": "The property Network.connections allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "maximumVersion": "2018.4"
- },
- {
- "id": "PAC0171",
- "type": "UnityEngine.HostData",
- "method": "ip",
- "areas": ["Memory"],
- "description": "The property HostData.ip allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "maximumVersion": "2018.4"
- },
- {
- "id": "PAC0172",
- "type": "UnityEngine.SortingLayer",
- "method": "layers",
- "areas": ["Memory"],
- "description": "The property SortingLayer.layers allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0173",
- "type": "UnityEngine.TextAsset",
- "method": "bytes",
- "areas": ["Memory"],
- "description": "The property TextAsset.bytes allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0175",
- "type": "UnityEngine.iOS.NotificationServices",
- "method": "deviceToken",
- "areas": ["Memory"],
- "description": "The property iOS.NotificationServices.deviceToken allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "maximumVersion": "2021.3",
- "platforms": ["iOS"]
- },
- {
- "id": "PAC0176",
- "type": "UnityEngine.iOS.NotificationServices",
- "method": "scheduledLocalNotifications",
- "areas": ["Memory"],
- "description": "The property iOS.NotificationServices.scheduledLocalNotifications allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "maximumVersion": "2021.3",
- "platforms": ["iOS"]
- },
- {
- "id": "PAC0177",
- "type": "UnityEngine.Sprite",
- "method": "vertices",
- "areas": ["Memory"],
- "description": "The property Sprite.vertices allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0178",
- "type": "UnityEngine.Sprite",
- "method": "triangles",
- "areas": ["Memory"],
- "description": "The property Sprite.triangles allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0179",
- "type": "UnityEngine.Sprite",
- "method": "uv",
- "areas": ["Memory"],
- "description": "The property Sprite.uv allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0180",
- "type": "UnityEngine.SocialPlatforms.ILocalUser",
- "method": "friends",
- "areas": ["Memory"],
- "description": "The property SocialPlatforms.ILocalUser.friends allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0181",
- "type": "UnityEngine.SocialPlatforms.ILeaderboard",
- "method": "scores",
- "areas": ["Memory"],
- "description": "The property SocialPlatforms.ILeaderboard.scores allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0182",
- "type": "UnityEngine.GUIStyleState",
- "method": "scaledBackgrounds",
- "areas": ["Memory"],
- "description": "The property GUIStyleState.scaledBackgrounds allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0183",
- "type": "UnityEngine.EdgeCollider2D",
- "method": "points",
- "areas": ["Memory"],
- "description": "The property EdgeCollider2D.points allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0184",
- "type": "UnityEngine.PolygonCollider2D",
- "method": "points",
- "areas": ["Memory"],
- "description": "The property PolygonCollider2D.points allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0185",
- "type": "UnityEngine.Terrain",
- "method": "activeTerrains",
- "areas": ["Memory"],
- "description": "The property Terrain.activeTerrains allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0186",
- "type": "UnityEngine.TerrainData",
- "method": "detailPrototypes",
- "areas": ["Memory"],
- "description": "The property TerrainData.detailPrototypes allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0187",
- "type": "UnityEngine.TerrainData",
- "method": "treePrototypes",
- "areas": ["Memory"],
- "description": "The property TerrainData.treePrototypes allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0188",
- "type": "UnityEngine.TerrainData",
- "method": "splatPrototypes",
- "areas": ["Memory"],
- "description": "The property TerrainData.splatPrototypes allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0189",
- "type": "UnityEngine.TerrainData",
- "method": "terrainLayers",
- "areas": ["Memory"],
- "description": "The property TerrainData.terrainLayers allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0190",
- "type": "UnityEngine.Tilemaps.TileAnimationData",
- "method": "animatedSprites",
- "areas": ["Memory"],
- "description": "The property Tilemaps.TileAnimationData.animatedSprites allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0191",
- "type": "UnityEngine.UIElements.UxmlAttributeDescription",
- "method": "obsoleteNames",
- "areas": ["Memory"],
- "description": "The property UIElements.UxmlAttributeDescription.obsoleteNames allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "minimumVersion": "2019.1"
- },
- {
- "id": "PAC0200",
- "type": "UnityEngine.Networking.IMultipartFormSection",
- "method": "sectionData",
- "areas": ["Memory"],
- "description": "The property Networking.IMultipartFormSection.sectionData allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0201",
- "type": "UnityEngine.Networking.MultipartFormDataSection",
- "method": "sectionData",
- "areas": ["Memory"],
- "description": "The property Networking.MultipartFormDataSection.sectionData allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0202",
- "type": "UnityEngine.Networking.MultipartFormFileSection",
- "method": "sectionData",
- "areas": ["Memory"],
- "description": "The property Networking.MultipartFormFileSection.sectionData allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0203",
- "type": "UnityEngine.WWWForm",
- "method": "data",
- "areas": ["Memory"],
- "description": "The property WWWForm.data allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0204",
- "type": "UnityEngine.Networking.DownloadHandler",
- "method": "data",
- "areas": ["Memory"],
- "description": "The property Networking.DownloadHandler.data allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0208",
- "type": "UnityEngine.Networking.UploadHandler",
- "method": "data",
- "areas": ["Memory"],
- "description": "The property Networking.UploadHandler.data allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0215",
- "type": "UnityEngine.Networking.NetworkMigrationManager",
- "method": "peers",
- "areas": ["Memory"],
- "description": "The property Networking.NetworkMigrationManager.peers allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "maximumVersion": "2018.4"
- },
- {
- "id": "PAC0216",
- "type": "UnityEngine.Networking.NetworkServerSimple",
- "method": "messageBuffer",
- "areas": ["Memory"],
- "description": "The property Networking.NetworkServerSimple.messageBuffer allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
- "maximumVersion": "2018.4"
- },
- {
- "id": "PAC0217",
- "type": "UnityEngine.WWW",
- "method": "bytes",
- "areas": ["Memory"],
- "description": "The property WWW.bytes allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0219",
- "type": "UnityEngine.XR.XRSettings",
- "method": "supportedDevices",
- "areas": ["Memory"],
- "description": "The property XR.XRSettings.supportedDevices allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0220",
- "type": "UnityEngine.TestTools.Constraints.AllocatingGCMemoryConstraint",
- "method": "Arguments",
- "areas": ["Memory"],
- "description": "The property TestTools.Constraints.AllocatingGCMemoryConstraint.Arguments allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0221",
- "type": "UnityEngine.TestTools.UnityPlatformAttribute",
- "method": "include",
- "areas": ["Memory"],
- "description": "The property TestTools.UnityPlatformAttribute.include allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0222",
- "type": "UnityEngine.TestTools.UnityPlatformAttribute",
- "method": "exclude",
- "areas": ["Memory"],
- "description": "The property TestTools.UnityPlatformAttribute.exclude allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC0223",
- "type": "UnityEngine.GameObject",
- "method": "tag",
- "areas": ["Memory"],
- "description": "The GameObject.tag property allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Prefer using GameObject.CompareTag() instead, as this does not result in managed allocations."
- },
- {
- "id": "PAC0224",
- "type": "UnityEngine.Object",
- "method": "Instantiate",
- "areas": ["CPU","Memory"],
- "description": "Creating Objects at runtime by calling Object.Instantiate can take a significant amount of CPU time and allocates managed memory.",
- "solution": "Try to avoid calling Object.Instantiate in frequently-updated code. Consider implementing an Object Pool. The ObjectPool class is available from Unity 2021.1 as a convenience."
- },
- {
- "id": "PAC0225",
- "type": "UnityEngine.GameObject",
- "method": "AddComponent",
- "areas": ["CPU","Memory"],
- "description": "Adding components to GameObjects at runtime can take a significant amount of CPU time and allocates managed memory.",
- "solution": "Try to avoid adding or removing components in frequently-updated code. Prefer instantiating GameObjects from Prefabs will all the necessary components instead."
- },
- {
- "id": "PAC0227",
- "type": "UnityEngine.Shader",
- "method": "WarmupAllShaders",
- "areas": ["CPU"],
- "defaultSeverity": 3,
- "description": "WarmupAllShaders does not work properly on Metal, Vulkan or DX12. This might result in unexpected CPU spikes due to shader compilation.",
- "solution": "Implement a shader pre-warming mechanism which renders a small triangle for each combination of vertex format and shader used at runtime. One way to achieve this is with the UnityEngine.Experimental.Rendering.ShaderWarmup API."
- },
- {
- "id": "PAC0228",
- "type": "UnityEngine.ShaderVariantCollection",
- "method": "WarmUp",
- "areas": ["CPU"],
- "defaultSeverity": 3,
- "description": "WarmUp does not work properly on Metal, Vulkan or DX12. This might result in unexpected CPU spikes due to shader compilation.",
- "solution": "Implement a shader pre-warming mechanism which renders a small triangle for each combination of vertex format and shader variant used at runtime. One way to achieve this is with the UnityEngine.Experimental.Rendering.ShaderWarmup API."
- },
- {
- "id": "PAC0229",
- "type": "UnityEngine.Component",
- "method": "tag",
- "areas": ["Memory"],
- "description": "The Component.tag property allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Prefer using CompareTag() instead, as this does not result in managed allocations."
- },
- {
- "id": "PAC0231",
- "type": "UnityEngine.Object",
- "method": "name",
- "areas": ["Memory"],
- "description": "The Object.name property allocates managed memory.",
- "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
- },
- {
- "id": "PAC1000",
- "type": "System.Linq",
- "method": "*",
- "areas": ["CPU","Memory"],
- "description": "Linq allocates large amounts of managed memory and exhibits poor CPU performance.",
- "solution": "We strongly advise against using Linq in any frequently-updated code. Ban its usage from the project entirely, or confine it to initialization code and use it sparingly."
- },
- {
- "id": "PAC1001",
- "type": "System.Reflection",
- "method": "*",
- "areas": ["CPU"],
- "description": "Reflection is slow, and not generally considered performant enough for runtime code.",
- "solution": "Remove code which relies on reflection, or minimise its usage, particularly outside of initialization."
- },
- {
- "id": "PAC1002",
- "type": "System.String",
- "method": "Concat",
- "areas": ["Memory"],
- "defaultSeverity": 5,
- "description": "String concatenation operations allocates managed memory.",
- "solution": "Try to avoid concatenating strings in frequently-updated code. Prefer using a StringBuilder instead, as this minimizes managed allocations."
- },
- {
- "id": "PAC1003",
- "type": "System.DateTime",
- "method": "Now",
- "areas": ["CPU"],
- "description": "System.DateTime.Now can take a lot of CPU time because it needs to figure out the current timezone and daylight saving time information.",
- "solution": "Try to avoid using this method in frequently-updated code. Prefer UnityEngine.Time.time or, if precise time is needed, use DateTime.UtcNow."
- },
- {
- "id": "PAC1004",
- "type": "System.AppDomain",
- "method": "GetAssemblies",
- "areas": ["CPU"],
- "description": "System.AppDomain.GetAssemblies can take a lot of CPU time.",
- "solution": "Try to minimize calls to System.AppDomain.GetAssemblies by caching the returned assemblies. When possible, use UnityEditor.TypeCache for fast access to types, methods and fields."
- },
- {
- "id": "PAC0232",
- "type": "UnityEditor.AssetDatabase",
- "method": "FindAssets",
- "areas": ["CPU"],
- "description": "UnityEditor.AssetDatabase.FindAssets is a CPU-intensive operation and can slow down the Editor for long periods of time on large projects.",
- "solution": "Try to minimize calls to UnityEditor.AssetDatabase.FindAssets."
- },
- {
- "id": "PAC0234",
- "type": "UnityEngine.Object",
- "method": "FindObjectOfType",
- "areas": ["CPU", "Memory"],
- "description": "Object.FindObjectOfType() allocates managed memory and can be slow.",
- "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
- }
- ]
-}
+[
+ {
+ "id": "PAC0000",
+ "type": "UnityEngine.Camera",
+ "method": "main",
+ "areas": ["CPU"],
+ "description": "Camera.main property uses FindGameObjectsWithTag() internally and doesn't cache the result.",
+ "solution": "It is advised to cache and use the camera component obtained from Game object instead.",
+ "maximumVersion": "2019.4.8"
+ },
+ {
+ "id": "PAC0001",
+ "type": "UnityEngine.WebCamTexture",
+ "method": "GetPixels",
+ "areas": ["Memory"],
+ "description": "WebCamTexture.GetPixels() allocates managed memory.",
+ "solution": "Use WebCamTexture.GetPixels32() instead."
+ },
+ {
+ "id": "PAC0002",
+ "type": "UnityEngine.WebCamTexture",
+ "method": "GetPixels32",
+ "areas": ["Memory"],
+ "description": "WebCamTexture.GetPixels32() allocates managed memory if a suitable array is not provided as a parameter.",
+ "solution": "Ensure that you pass an array of Color32[] to this API method for it to fill out, to avoid creating a new array every time the method is called."
+ },
+ {
+ "id": "PAC0003",
+ "type": "UnityEngine.GeometryUtility",
+ "method": "CalculateFrustumPlanes",
+ "areas": ["Memory"],
+ "description": "Some versions of GeometryUtility.CalculateFrustumPlanes() allocate managed memory.",
+ "solution": "Ensure that you use the CalculateFrustumPlanes(Matrix4x4 worldToProjectionMatrix, Plane[] planes) version of this API method, in order to be able to pass a pre-allocated Array of Planes."
+ },
+ {
+ "id": "PAC0004",
+ "type": "UnityEngine.Resources",
+ "method": "FindObjectsOfTypeAll",
+ "areas": ["Memory"],
+ "description": "Resources.FindObjectsOfTypeAll() allocates managed memory.",
+ "solution": "Use Resources.FindObjectsOfTypeNonAlloc() instead."
+ },
+ {
+ "id": "PAC0005",
+ "type": "UnityEngine.Texture2D",
+ "method": "GetPixels",
+ "areas": ["Memory"],
+ "description": "Texture2D.GetPixels() allocates managed memory.",
+ "solution": "Use Texture2D.GetRawTextureData() instead. This method returns a NativeArray of pixel data, and so does not allocate managed memory."
+ },
+ {
+ "id": "PAC0006",
+ "type": "UnityEngine.Texture2D",
+ "method": "GetPixels32",
+ "areas": ["Memory"],
+ "description": "Texture2D.GetPixels32() allocates managed memory.",
+ "solution": "Use Texture2D.GetRawTextureData() instead. This method returns a NativeArray of pixel data, and so does not allocate managed memory."
+ },
+ {
+ "id": "PAC0007",
+ "type": "UnityEngine.Rigidbody",
+ "method": "SweepTestAll",
+ "areas": ["Memory"],
+ "description": "Rigidbody.SweepTestAll() allocates managed memory.",
+ "solution": "Use Rigidbody.SweepTestNonAlloc() instead."
+ },
+ {
+ "id": "PAC0008",
+ "type": "UnityEngine.Physics",
+ "method": "RaycastAll",
+ "areas": ["Memory"],
+ "description": "Physics.RaycastAll() allocates managed memory.",
+ "solution": "Use Physics.RaycastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0009",
+ "type": "UnityEngine.Physics",
+ "method": "CapsuleCastAll",
+ "areas": ["Memory"],
+ "description": "Physics.CapsuleCastAll() allocates managed memory.",
+ "solution": "Use Physics.CapsuleCastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0010",
+ "type": "UnityEngine.Physics",
+ "method": "SphereCastAll",
+ "areas": ["Memory"],
+ "description": "Physics.SphereCastAll() allocates managed memory.",
+ "solution": "Use Physics.SphereCastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0011",
+ "type": "UnityEngine.Physics",
+ "method": "BoxCastAll",
+ "areas": ["Memory"],
+ "description": "Physics.BoxCastAll() allocates managed memory.",
+ "solution": "Use Physics.BoxCastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0012",
+ "type": "UnityEngine.Physics",
+ "method": "OverlapCapsule",
+ "areas": ["Memory"],
+ "description": "Physics.OverlapCapsule() allocates managed memory.",
+ "solution": "Use Physics.OverlapCapsuleNonAlloc() instead."
+ },
+ {
+ "id": "PAC0013",
+ "type": "UnityEngine.Physics",
+ "method": "OverlapSphere",
+ "areas": ["Memory"],
+ "description": "Physics.OverlapSphere() allocates managed memory.",
+ "solution": "Use Physics.OverlapSphereNonAlloc() instead."
+ },
+ {
+ "id": "PAC0014",
+ "type": "UnityEngine.Physics",
+ "method": "OverlapBox",
+ "areas": ["Memory"],
+ "description": "Physics.OverlapBox() allocates managed memory.",
+ "solution": "Use Physics.OverlapBoxNonAlloc() instead."
+ },
+ {
+ "id": "PAC0015",
+ "type": "UnityEngine.Physics2D",
+ "method": "LinecastAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.LinecastAll() allocates managed memory.",
+ "solution": "Use Physics2D.LinecastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0016",
+ "type": "UnityEngine.Physics2D",
+ "method": "RaycastAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.RaycastAll() allocates managed memory.",
+ "solution": "Use Physics2D.RaycastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0017",
+ "type": "UnityEngine.Physics2D",
+ "method": "CircleCastAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.CircleCastAll() allocates managed memory.",
+ "solution": "Use Physics2D.CircleCastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0018",
+ "type": "UnityEngine.Physics2D",
+ "method": "BoxCastAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.BoxCastAll() allocates managed memory.",
+ "solution": "Use Physics2D.BoxCastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0019",
+ "type": "UnityEngine.Physics2D",
+ "method": "CapsuleCastAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.CapsuleCastAll() allocates managed memory.",
+ "solution": "Use Physics2D.CapsuleCastNonAlloc() instead."
+ },
+ {
+ "id": "PAC0020",
+ "type": "UnityEngine.Physics2D",
+ "method": "GetRayIntersectionAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.GetRayIntersectionAll() allocates managed memory.",
+ "solution": "Use Physics2D.GetRayIntersectionNonAlloc() instead."
+ },
+ {
+ "id": "PAC0021",
+ "type": "UnityEngine.Physics2D",
+ "method": "OverlapPointAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.OverlapPointAll() allocates managed memory.",
+ "solution": "Use Physics2D.OverlapPointNonAlloc() instead."
+ },
+ {
+ "id": "PAC0022",
+ "type": "UnityEngine.Physics2D",
+ "method": "OverlapCircleAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.OverlapCircleAll() allocates managed memory.",
+ "solution": "Use Physics2D.OverlapCircleNonAlloc() instead."
+ },
+ {
+ "id": "PAC0023",
+ "type": "UnityEngine.Physics2D",
+ "method": "OverlapBoxAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.OverlapBoxAll() allocates managed memory.",
+ "solution": "Use Physics2D.OverlapBoxNonAlloc() instead."
+ },
+ {
+ "id": "PAC0024",
+ "type": "UnityEngine.Physics2D",
+ "method": "OverlapAreaAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.OverlapAreaAll() allocates managed memory.",
+ "solution": "Use Physics2D.OverlapAreaNonAlloc() instead."
+ },
+ {
+ "id": "PAC0025",
+ "type": "UnityEngine.Physics2D",
+ "method": "OverlapCapsuleAll",
+ "areas": ["Memory"],
+ "description": "Physics2D.OverlapCapsuleAll() allocates managed memory.",
+ "solution": "Use Physics2D.OverlapCapsuleNonAlloc() instead."
+ },
+ {
+ "id": "PAC0026",
+ "type": "UnityEngine.Component",
+ "method": "GetComponentsInChildren",
+ "areas": ["Memory"],
+ "description": "Component.GetComponentsInChildren() allocates managed memory.",
+ "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInChildren() which accepts a List as a parameter and populates it with the components it finds."
+ },
+ {
+ "id": "PAC0027",
+ "type": "UnityEngine.Component",
+ "method": "GetComponentsInParent",
+ "areas": ["Memory"],
+ "description": "Component.GetComponentsInParent() allocates managed memory.",
+ "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInParent() which accepts a List as a parameter and populates it with the components it finds."
+ },
+ {
+ "id": "PAC0028",
+ "type": "UnityEngine.GameObject",
+ "method": "GetComponentsInChildren",
+ "areas": ["Memory"],
+ "description": "Some versions of GameObject.GetComponentsInChildren() allocate managed memory.",
+ "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInChildren() which accepts a List as a parameter and populates it with the components it finds."
+ },
+ {
+ "id": "PAC0029",
+ "type": "UnityEngine.GameObject",
+ "method": "GetComponentsInParent",
+ "areas": ["Memory"],
+ "description": "Some versions of GameObject.GetComponentsInParent() allocate managed memory.",
+ "solution": "Ensure you are using one of the versions of GameObject.GetComponentsInParent() which accepts a List as a parameter and populates it with the components it finds."
+ },
+ {
+ "id": "PAC0030",
+ "type": "UnityEngine.Collider",
+ "method": "OnTriggerStay",
+ "areas": ["CPU"],
+ "description": "OnTriggerStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many Colliders which implement this method.",
+ "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay() methods, and consider refactoring code to not use them."
+ },
+ {
+ "id": "PAC0031",
+ "type": "UnityEngine.MonoBehaviour",
+ "method": "OnTriggerStay",
+ "areas": ["CPU"],
+ "description": "OnTriggerStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many MonoBehaviours which implement this method.",
+ "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay() methods, and consider refactoring code to not use them."
+ },
+ {
+ "id": "PAC0032",
+ "type": "UnityEngine.Collider2D",
+ "method": "OnTriggerStay2D",
+ "areas": ["CPU"],
+ "description": "OnTriggerStay2D() methods can detrimentally affect performance if they perform a lot of processing or if there are many Collider2Ds which implement this method.",
+ "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay2D() methods, and consider refactoring code to not use them."
+ },
+ {
+ "id": "PAC0033",
+ "type": "UnityEngine.MonoBehaviour",
+ "method": "OnTriggerStay2D",
+ "areas": ["CPU"],
+ "description": "OnTriggerStay2D() methods can detrimentally affect performance if they perform a lot of processing or if there are many MonoBehaviours which implement this method.",
+ "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnTriggerStay2D() methods, and consider refactoring code to not use them."
+ },
+ {
+ "id": "PAC0034",
+ "type": "UnityEngine.Collider",
+ "method": "OnCollisionStay",
+ "areas": ["CPU"],
+ "description": "OnCollisionStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many Colliders which implement this method.",
+ "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnCollisionStay() methods, and consider refactoring code to not use them."
+ },
+ {
+ "id": "PAC0035",
+ "type": "UnityEngine.MonoBehaviour",
+ "method": "OnCollisionStay",
+ "areas": ["CPU"],
+ "description": "OnCollisionStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many MonoBehaviours which implement this method.",
+ "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnCollisionStay() methods, and consider refactoring code to not use them."
+ },
+ {
+ "id": "PAC0036",
+ "type": "UnityEngine.Rigidbody",
+ "method": "OnCollisionStay",
+ "areas": ["CPU"],
+ "description": "OnCollisionStay() methods can detrimentally affect performance if they perform a lot of processing or if there are many RigidBodies which implement this method.",
+ "solution": "Profile CPU performance to look for bottlenecks, examine the contents of all OnCollisionStay() methods, and consider refactoring code to not use them."
+ },
+ {
+ "id": "PAC0037",
+ "type": "UnityEngine.ImageConversion",
+ "method": "LoadImage",
+ "areas": ["Memory"],
+ "description": "ImageConversion.LoadImage() defaults to maintaining a CPU-accessible copy of the image. This is a waste of memory if not needed.",
+ "solution": "If a CPU-accessible copy of the texture is not required, ensure that the markNonReadable flag passed into the method is set to true."
+ },
+ {
+ "id": "PAC0039",
+ "type": "UnityEngine.Renderer",
+ "method": "material",
+ "areas": ["GPU"],
+ "description": "The Renderer.material property creates a unique copy of the Renderer's material. This breaks draw call batching and results in a higher number of draw calls, impacting rendering performance.",
+ "solution": "If possible, use Renderer.sharedMaterial instead."
+ },
+ {
+ "id": "PAC0051",
+ "type": "UnityEngine.ComputeBuffer",
+ "method": "GetData",
+ "areas": ["CPU"],
+ "description": "ComputeBuffer.GetData() stalls the CPU until the GPU has finished accessing the buffer. This can lead to significant CPU performance problems.",
+ "solution": "Avoid reading back from ComputeBuffers if it is at all possible. If it's unavoidable, profile your project carefully and regularly to monitor the performance impact."
+ },
+ {
+ "id": "PAC0052",
+ "type": "UnityEngine.Texture2D",
+ "method": "SetPixels",
+ "areas": ["CPU"],
+ "description": "Texture2D.SetPixels() is slower than Texture2D.SetPixels32().",
+ "solution": "Use Texture2D.SetPixels32(), Texture2D.GetRawTextureData(), or Texture2D.Apply() instead."
+ },
+ {
+ "id": "PAC0053",
+ "type": "UnityEngine.Texture3D",
+ "method": "SetPixels",
+ "areas": ["CPU"],
+ "description": "Texture3D.SetPixels() is slower than Texture3D.SetPixels32().",
+ "solution": "Use Texture3D.SetPixels32() instead."
+ },
+ {
+ "id": "PAC0054",
+ "type": "UnityEngine.Texture2DArray",
+ "method": "SetPixels",
+ "areas": ["CPU"],
+ "description": "Texture2DArray.SetPixels() is slower than Texture2DArray.SetPixels32().",
+ "solution": "Use Texture2DArray.SetPixels32() instead."
+ },
+ {
+ "id": "PAC0055",
+ "type": "UnityEngine.CubemapArray",
+ "method": "SetPixels",
+ "areas": ["CPU"],
+ "description": "CubemapArray.SetPixels() is slower than CubemapArray.SetPixels32().",
+ "solution": "Use CubemapArray.SetPixels32() instead."
+ },
+ {
+ "id": "PAC0056",
+ "type": "UnityEngine.GameObject",
+ "method": "SendMessage",
+ "areas": ["CPU"],
+ "description": "GameObject.SendMessage() is a very slow and CPU-intensive method.",
+ "solution": "Implement a custom system to replace SendMessage - get the components you want to send messages to and call methods directly on them."
+ },
+ {
+ "id": "PAC0057",
+ "type": "UnityEngine.Component",
+ "method": "SendMessage",
+ "areas": ["CPU"],
+ "description": "Component.SendMessage() is a very slow and CPU-intensive method.",
+ "solution": "Implement a custom system to replace SendMessage - get the components you want to send messages to and call methods directly on them."
+ },
+ {
+ "id": "PAC0058",
+ "type": "UnityEngine.MonoBehaviour",
+ "method": "OnGUI",
+ "areas": ["CPU"],
+ "description": "OnGUI() is used by the legacy Immediate Mode GUI (IMGUI), which is extremely CPU-intensive. If a single OnGUI() method is present in a project's code, IMGUI will initialize and consume CPU time.",
+ "solution": "Remove all OnGUI() methods from the project code."
+ },
+ {
+ "id": "PAC0059",
+ "type": "UnityEngine.AI.NavMeshPath",
+ "method": "corners",
+ "areas": ["Memory"],
+ "description": "The property AI.NavMeshPath.corners allocates managed memory.",
+ "solution": "Use AI.NavMeshPath.GetCornersNonAlloc() instead."
+ },
+ {
+ "id": "PAC0060",
+ "type": "UnityEngine.Animator",
+ "method": "parameters",
+ "areas": ["Memory"],
+ "description": "The property Animator.parameters allocates managed memory.",
+ "solution": "Use Animator.GetParameter() instead."
+ },
+ {
+ "id": "PAC0061",
+ "type": "UnityEngine.Animations.ParentConstraint",
+ "method": "translationOffsets",
+ "areas": ["Memory"],
+ "description": "The property Animations.ParentConstraint.translationOffsets allocates managed memory.",
+ "solution": "Use Animations.ParentConstraint.GetTranslationOffset() instead."
+ },
+ {
+ "id": "PAC0062",
+ "type": "UnityEngine.Animations.ParentConstraint",
+ "method": "rotationOffsets",
+ "areas": ["Memory"],
+ "description": "The property Animations.ParentConstraint.rotationOffsets allocates managed memory.",
+ "solution": "Use Animations.ParentConstraint.GetRotationOffset() instead."
+ },
+ {
+ "id": "PAC0063",
+ "type": "UnityEngine.AnimationCurve",
+ "method": "keys",
+ "areas": ["Memory"],
+ "description": "The property AnimationCurve.keys allocates managed memory.",
+ "solution": "Use AnimationCurve.AddKey(), AnimationCurve.MoveKey() or AnimationCurve.RemoveKey() instead."
+ },
+ {
+ "id": "PAC0066",
+ "type": "UnityEngine.Camera",
+ "method": "allCameras",
+ "areas": ["Memory"],
+ "description": "The property Camera.allCameras allocates managed memory.",
+ "solution": "Use Camera.GetAllCameras() instead."
+ },
+ {
+ "id": "PAC0067",
+ "type": "UnityEngine.Mesh",
+ "method": "boneWeights",
+ "areas": ["Memory"],
+ "description": "The property Mesh.boneWeights allocates managed memory.",
+ "solution": "Use Mesh.GetAllBoneWeights() instead. This method returns a NativeArray of BoneWeight1, and so does not allocate managed memory."
+ },
+ {
+ "id": "PAC0068",
+ "type": "UnityEngine.Mesh",
+ "method": "bindposes",
+ "areas": ["Memory"],
+ "description": "The property Mesh.bindposes allocates managed memory.",
+ "solution": "Use Mesh.GetBindposes() instead."
+ },
+ {
+ "id": "PAC0069",
+ "type": "UnityEngine.Mesh",
+ "method": "vertices",
+ "areas": ["Memory"],
+ "description": "The property Mesh.vertices allocates managed memory.",
+ "solution": "Use Mesh.GetVertices() instead."
+ },
+ {
+ "id": "PAC0070",
+ "type": "UnityEngine.Mesh",
+ "method": "normals",
+ "areas": ["Memory"],
+ "description": "The property Mesh.normals allocates managed memory.",
+ "solution": "Use Mesh.GetNormals() instead."
+ },
+ {
+ "id": "PAC0071",
+ "type": "UnityEngine.Mesh",
+ "method": "tangents",
+ "areas": ["Memory"],
+ "description": "The property Mesh.tangents allocates managed memory.",
+ "solution": "Use Mesh.GetTangents() instead."
+ },
+ {
+ "id": "PAC0072",
+ "type": "UnityEngine.Mesh",
+ "method": "uv",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0073",
+ "type": "UnityEngine.Mesh",
+ "method": "uv1",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv1 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0074",
+ "type": "UnityEngine.Mesh",
+ "method": "uv2",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv2 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0075",
+ "type": "UnityEngine.Mesh",
+ "method": "uv3",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv3 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0076",
+ "type": "UnityEngine.Mesh",
+ "method": "uv4",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv4 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0077",
+ "type": "UnityEngine.Mesh",
+ "method": "uv5",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv5 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0078",
+ "type": "UnityEngine.Mesh",
+ "method": "uv6",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv6 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0079",
+ "type": "UnityEngine.Mesh",
+ "method": "uv7",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv7 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0080",
+ "type": "UnityEngine.Mesh",
+ "method": "uv8",
+ "areas": ["Memory"],
+ "description": "The property Mesh.uv8 allocates managed memory.",
+ "solution": "Use Mesh.GetUVs() instead."
+ },
+ {
+ "id": "PAC0081",
+ "type": "UnityEngine.Mesh",
+ "method": "colors",
+ "areas": ["Memory"],
+ "description": "The property Mesh.colors allocates managed memory.",
+ "solution": "Use Mesh.GetColors() instead."
+ },
+ {
+ "id": "PAC0082",
+ "type": "UnityEngine.Mesh",
+ "method": "colors32",
+ "areas": ["Memory"],
+ "description": "The property Mesh.colors32 allocates managed memory.",
+ "solution": "Use Mesh.GetColors() instead."
+ },
+ {
+ "id": "PAC0083",
+ "type": "UnityEngine.Mesh",
+ "method": "triangles",
+ "areas": ["Memory"],
+ "description": "The property Mesh.triangles allocates managed memory.",
+ "solution": "Use Mesh.GetTriangles() instead."
+ },
+ {
+ "id": "PAC0084",
+ "type": "UnityEngine.Renderer",
+ "method": "materials",
+ "areas": ["Memory"],
+ "description": "The property Renderer.materials allocates managed memory.",
+ "solution": "Use Renderer.GetMaterials() instead."
+ },
+ {
+ "id": "PAC0085",
+ "type": "UnityEngine.Renderer",
+ "method": "sharedMaterials",
+ "areas": ["Memory"],
+ "description": "The property Renderer.sharedMaterials allocates managed memory.",
+ "solution": "Use Renderer.GetSharedMaterials() instead."
+ },
+ {
+ "id": "PAC0094",
+ "type": "UnityEngine.Input",
+ "method": "touches",
+ "areas": ["Memory"],
+ "description": "The property Input.touches allocates managed memory.",
+ "solution": "Use Input.GetTouch() instead."
+ },
+ {
+ "id": "PAC0095",
+ "type": "UnityEngine.Input",
+ "method": "accelerationEvents",
+ "areas": ["Memory"],
+ "description": "The property Input.accelerationEvents allocates managed memory.",
+ "solution": "Use Input.GetAccelerationEvent() instead."
+ },
+ {
+ "id": "PAC0096",
+ "type": "UnityEngine.iOS.NotificationServices",
+ "method": "localNotifications",
+ "areas": ["Memory"],
+ "description": "The property iOS.NotificationServices.localNotifications allocates managed memory.",
+ "solution": "Use iOS.NotificationServices.GetLocalNotification() instead.",
+ "maximumVersion": "2021.3",
+ "platforms": ["iOS"]
+ },
+ {
+ "id": "PAC0097",
+ "type": "UnityEngine.iOS.NotificationServices",
+ "method": "remoteNotifications",
+ "areas": ["Memory"],
+ "description": "The property iOS.NotificationServices.remoteNotifications allocates managed memory.",
+ "solution": "Use iOS.NotificationServices.GetRemoteNotification() instead.",
+ "maximumVersion": "2021.3",
+ "platforms": ["iOS"]
+ },
+ {
+ "id": "PAC0100",
+ "type": "UnityEngine.GUISkin",
+ "method": "customStyles",
+ "areas": ["Memory"],
+ "description": "The property GUISkin.customStyles allocates managed memory.",
+ "solution": "Use GUISkin.GetStyle() or GUISkin.FindStyle() instead."
+ },
+ {
+ "id": "PAC0103",
+ "type": "UnityEngine.Collision",
+ "method": "contacts",
+ "areas": ["Memory"],
+ "description": "The property Collision.contacts allocates managed memory.",
+ "solution": "Use Collision.GetContacts() instead."
+ },
+ {
+ "id": "PAC0104",
+ "type": "UnityEngine.Collision2D",
+ "method": "contacts",
+ "areas": ["Memory"],
+ "description": "The property Collision2D.contacts allocates managed memory.",
+ "solution": "Use Collision2D.GetContacts() instead."
+ },
+ {
+ "id": "PAC0110",
+ "type": "UnityEngine.TerrainData",
+ "method": "treeInstances",
+ "areas": ["Memory"],
+ "description": "The property TerrainData.treeInstances allocates managed memory.",
+ "solution": "Use TerrainData.GetTreeInstance() instead."
+ },
+ {
+ "id": "PAC0111",
+ "type": "UnityEngine.TerrainData",
+ "method": "alphamapTextures",
+ "areas": ["Memory"],
+ "description": "The property TerrainData.alphamapTextures allocates managed memory.",
+ "solution": "Use TerrainData.GetAlphamapTexture() instead."
+ },
+ {
+ "id": "PAC0112",
+ "type": "UnityEngine.Font",
+ "method": "characterInfo",
+ "areas": ["Memory"],
+ "description": "The property Font.characterInfo allocates managed memory.",
+ "solution": "Use Font.GetCharacterInfo() instead."
+ },
+ {
+ "id": "PAC0115",
+ "type": "UnityEngine.Animator",
+ "method": "GetCurrentAnimatorClipInfo",
+ "areas": ["Memory"],
+ "description": "Animator.GetCurrentAnimatorClipInfo() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0116",
+ "type": "UnityEngine.Animator",
+ "method": "GetBehaviours",
+ "areas": ["Memory"],
+ "description": "Animator.GetBehaviours() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0117",
+ "type": "UnityEngine.AssetBundle",
+ "method": "LoadAssetWithSubAssets",
+ "areas": ["Memory"],
+ "description": "AssetBundle.LoadAssetWithSubAssets() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0118",
+ "type": "UnityEngine.AssetBundle",
+ "method": "LoadAllAssets",
+ "areas": ["Memory"],
+ "description": "AssetBundle.LoadAllAssets() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0119",
+ "type": "UnityEngine.AssetBundleManifest",
+ "method": "GetAllAssetBundles",
+ "areas": ["Memory"],
+ "description": "AssetBundleManifest.GetAllAssetBundles() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0120",
+ "type": "UnityEngine.Resources",
+ "method": "LoadAll",
+ "areas": ["Memory"],
+ "description": "Resources.LoadAll() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0121",
+ "type": "UnityEngine.Texture2D",
+ "method": "PackTextures",
+ "areas": ["Memory"],
+ "description": "Texture2D.PackTextures() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0122",
+ "type": "UnityEngine.Cubemap",
+ "method": "GetPixels",
+ "areas": ["Memory"],
+ "description": "Cubemap.GetPixels() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0123",
+ "type": "UnityEngine.Texture3D",
+ "method": "GetPixels",
+ "areas": ["Memory"],
+ "description": "Texture3D.GetPixels() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0124",
+ "type": "UnityEngine.Texture3D",
+ "method": "GetPixels32",
+ "areas": ["Memory"],
+ "description": "Texture3D.GetPixels32() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0125",
+ "type": "UnityEngine.Texture2DArray",
+ "method": "GetPixels",
+ "areas": ["Memory"],
+ "description": "Texture2DArray.GetPixels() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0126",
+ "type": "UnityEngine.Texture2DArray",
+ "method": "GetPixels32",
+ "areas": ["Memory"],
+ "description": "Texture2DArray.GetPixels32() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0127",
+ "type": "UnityEngine.CubemapArray",
+ "method": "GetPixels",
+ "areas": ["Memory"],
+ "description": "CubemapArray.GetPixels() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0128",
+ "type": "UnityEngine.CubemapArray",
+ "method": "GetPixels32",
+ "areas": ["Memory"],
+ "description": "CubemapArray.GetPixels32() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0129",
+ "type": "UnityEngine.Object",
+ "method": "FindObjectsOfType",
+ "areas": ["CPU", "Memory"],
+ "description": "Object.FindObjectsOfType() allocates managed memory and can be slow.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0130",
+ "type": "UnityEngine.Windows.Crypto",
+ "method": "ComputeMD5Hash",
+ "areas": ["Memory"],
+ "description": "Windows.Crypto.ComputeMD5Hash() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0131",
+ "type": "UnityEngine.Windows.File",
+ "method": "ReadAllBytes",
+ "areas": ["Memory"],
+ "description": "Windows.File.ReadAllBytes() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0132",
+ "type": "UnityEngine.ImageConversion",
+ "method": "EncodeToJPG",
+ "areas": ["Memory"],
+ "description": "ImageConversion.EncodeToJPG() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0133",
+ "type": "UnityEngine.ImageConversion",
+ "method": "EncodeToEXR",
+ "areas": ["Memory"],
+ "description": "ImageConversion.EncodeToEXR() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0134",
+ "type": "UnityEngine.ImageConversion",
+ "method": "EncodeToTGA",
+ "areas": ["Memory"],
+ "description": "ImageConversion.EncodeToTGA() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0135",
+ "type": "UnityEngine.ImageConversion",
+ "method": "EncodeToPNG",
+ "areas": ["Memory"],
+ "description": "ImageConversion.EncodeToPNG() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0136",
+ "type": "UnityEngine.U2D.SpriteShapeUtility",
+ "method": "Generate",
+ "areas": ["Memory"],
+ "description": "U2D.SpriteShapeUtility.Generate() allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "minimumVersion": "2019.3"
+ },
+ {
+ "id": "PAC0138",
+ "type": "UnityEngine.AI.NavMeshTriangulation",
+ "method": "layers",
+ "areas": ["Memory"],
+ "description": "The property AI.NavMeshTriangulation.layers allocates managed memory.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0139",
+ "type": "UnityEngine.AnimationClip",
+ "method": "events",
+ "areas": ["Memory"],
+ "description": "The property AnimationClip.events allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0140",
+ "type": "UnityEngine.AnimatorOverrideController",
+ "method": "animationClips",
+ "areas": ["Memory"],
+ "description": "The property AnimatorOverrideController.animationClips allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0141",
+ "type": "UnityEngine.HumanTrait",
+ "method": "MuscleName",
+ "areas": ["Memory"],
+ "description": "The property HumanTrait.MuscleName allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0142",
+ "type": "UnityEngine.HumanTrait",
+ "method": "BoneName",
+ "areas": ["Memory"],
+ "description": "The property HumanTrait.BoneName allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0143",
+ "type": "UnityEngine.RuntimeAnimatorController",
+ "method": "animationClips",
+ "areas": ["Memory"],
+ "description": "The property RuntimeAnimatorController.animationClips allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0144",
+ "type": "UnityEngine.AssetBundleRequest",
+ "method": "allAssets",
+ "areas": ["Memory"],
+ "description": "The property AssetBundleRequest.allAssets allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0145",
+ "type": "UnityEngine.Microphone",
+ "method": "devices",
+ "areas": ["Memory"],
+ "description": "The property Microphone.devices allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0146",
+ "type": "UnityEngine.WebCamDevice",
+ "method": "availableResolutions",
+ "areas": ["Memory"],
+ "description": "The property WebCamDevice.availableResolutions allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0147",
+ "type": "UnityEngine.WebCamTexture",
+ "method": "devices",
+ "areas": ["Memory"],
+ "description": "The property WebCamTexture.devices allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0148",
+ "type": "UnityEngine.Cloth",
+ "method": "vertices",
+ "areas": ["Memory"],
+ "description": "The property Cloth.vertices allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0149",
+ "type": "UnityEngine.Cloth",
+ "method": "normals",
+ "areas": ["Memory"],
+ "description": "The property Cloth.normals allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0150",
+ "type": "UnityEngine.Cloth",
+ "method": "coefficients",
+ "areas": ["Memory"],
+ "description": "The property Cloth.coefficients allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0151",
+ "type": "UnityEngine.Cloth",
+ "method": "capsuleColliders",
+ "areas": ["Memory"],
+ "description": "The property Cloth.capsuleColliders allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0152",
+ "type": "UnityEngine.Cloth",
+ "method": "sphereColliders",
+ "areas": ["Memory"],
+ "description": "The property Cloth.sphereColliders allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0153",
+ "type": "UnityEngine.Camera",
+ "method": "layerCullDistances",
+ "areas": ["Memory"],
+ "description": "The property Camera.layerCullDistances allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0154",
+ "type": "UnityEngine.CrashReport",
+ "method": "reports",
+ "areas": ["Memory"],
+ "description": "The property CrashReport.reports allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0155",
+ "type": "UnityEngine.Gradient",
+ "method": "colorKeys",
+ "areas": ["Memory"],
+ "description": "The property Gradient.colorKeys allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0156",
+ "type": "UnityEngine.Gradient",
+ "method": "alphaKeys",
+ "areas": ["Memory"],
+ "description": "The property Gradient.alphaKeys allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0157",
+ "type": "UnityEngine.Screen",
+ "method": "resolutions",
+ "areas": ["Memory"],
+ "description": "The property Screen.resolutions allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0158",
+ "type": "UnityEngine.LightmapSettings",
+ "method": "lightmaps",
+ "areas": ["Memory"],
+ "description": "The property LightmapSettings.lightmaps allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0159",
+ "type": "UnityEngine.LightProbes",
+ "method": "positions",
+ "areas": ["Memory"],
+ "description": "The property LightProbes.positions allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0160",
+ "type": "UnityEngine.LightProbes",
+ "method": "bakedProbes",
+ "areas": ["Memory"],
+ "description": "The property LightProbes.bakedProbes allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0161",
+ "type": "UnityEngine.LightProbes",
+ "method": "coefficients",
+ "areas": ["Memory"],
+ "description": "The property LightProbes.coefficients allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0162",
+ "type": "UnityEngine.QualitySettings",
+ "method": "names",
+ "areas": ["Memory"],
+ "description": "The property QualitySettings.names allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0163",
+ "type": "UnityEngine.Material",
+ "method": "shaderKeywords",
+ "areas": ["Memory"],
+ "description": "The property Material.shaderKeywords allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0164",
+ "type": "UnityEngine.Light",
+ "method": "layerShadowCullDistances",
+ "areas": ["Memory"],
+ "description": "The property Light.layerShadowCullDistances allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0165",
+ "type": "UnityEngine.Rendering.RenderTargetBinding",
+ "method": "colorRenderTargets",
+ "areas": ["Memory"],
+ "description": "The property Rendering.RenderTargetBinding.colorRenderTargets allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0166",
+ "type": "UnityEngine.Rendering.RenderTargetBinding",
+ "method": "colorLoadActions",
+ "areas": ["Memory"],
+ "description": "The property Rendering.RenderTargetBinding.colorLoadActions allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0167",
+ "type": "UnityEngine.Rendering.RenderTargetBinding",
+ "method": "colorStoreActions",
+ "areas": ["Memory"],
+ "description": "The property Rendering.RenderTargetBinding.colorStoreActions allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0168",
+ "type": "UnityEngine.SkinnedMeshRenderer",
+ "method": "bones",
+ "areas": ["Memory"],
+ "description": "The property SkinnedMeshRenderer.bones allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0169",
+ "type": "UnityEngine.LightProbeGroup",
+ "method": "probePositions",
+ "areas": ["Memory"],
+ "description": "The property LightProbeGroup.probePositions allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0170",
+ "type": "UnityEngine.Network",
+ "method": "connections",
+ "areas": ["Memory"],
+ "description": "The property Network.connections allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "maximumVersion": "2018.4"
+ },
+ {
+ "id": "PAC0171",
+ "type": "UnityEngine.HostData",
+ "method": "ip",
+ "areas": ["Memory"],
+ "description": "The property HostData.ip allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "maximumVersion": "2018.4"
+ },
+ {
+ "id": "PAC0172",
+ "type": "UnityEngine.SortingLayer",
+ "method": "layers",
+ "areas": ["Memory"],
+ "description": "The property SortingLayer.layers allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0173",
+ "type": "UnityEngine.TextAsset",
+ "method": "bytes",
+ "areas": ["Memory"],
+ "description": "The property TextAsset.bytes allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0175",
+ "type": "UnityEngine.iOS.NotificationServices",
+ "method": "deviceToken",
+ "areas": ["Memory"],
+ "description": "The property iOS.NotificationServices.deviceToken allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "maximumVersion": "2021.3",
+ "platforms": ["iOS"]
+ },
+ {
+ "id": "PAC0176",
+ "type": "UnityEngine.iOS.NotificationServices",
+ "method": "scheduledLocalNotifications",
+ "areas": ["Memory"],
+ "description": "The property iOS.NotificationServices.scheduledLocalNotifications allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "maximumVersion": "2021.3",
+ "platforms": ["iOS"]
+ },
+ {
+ "id": "PAC0177",
+ "type": "UnityEngine.Sprite",
+ "method": "vertices",
+ "areas": ["Memory"],
+ "description": "The property Sprite.vertices allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0178",
+ "type": "UnityEngine.Sprite",
+ "method": "triangles",
+ "areas": ["Memory"],
+ "description": "The property Sprite.triangles allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0179",
+ "type": "UnityEngine.Sprite",
+ "method": "uv",
+ "areas": ["Memory"],
+ "description": "The property Sprite.uv allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0180",
+ "type": "UnityEngine.SocialPlatforms.ILocalUser",
+ "method": "friends",
+ "areas": ["Memory"],
+ "description": "The property SocialPlatforms.ILocalUser.friends allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0181",
+ "type": "UnityEngine.SocialPlatforms.ILeaderboard",
+ "method": "scores",
+ "areas": ["Memory"],
+ "description": "The property SocialPlatforms.ILeaderboard.scores allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0182",
+ "type": "UnityEngine.GUIStyleState",
+ "method": "scaledBackgrounds",
+ "areas": ["Memory"],
+ "description": "The property GUIStyleState.scaledBackgrounds allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0183",
+ "type": "UnityEngine.EdgeCollider2D",
+ "method": "points",
+ "areas": ["Memory"],
+ "description": "The property EdgeCollider2D.points allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0184",
+ "type": "UnityEngine.PolygonCollider2D",
+ "method": "points",
+ "areas": ["Memory"],
+ "description": "The property PolygonCollider2D.points allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0185",
+ "type": "UnityEngine.Terrain",
+ "method": "activeTerrains",
+ "areas": ["Memory"],
+ "description": "The property Terrain.activeTerrains allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0186",
+ "type": "UnityEngine.TerrainData",
+ "method": "detailPrototypes",
+ "areas": ["Memory"],
+ "description": "The property TerrainData.detailPrototypes allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0187",
+ "type": "UnityEngine.TerrainData",
+ "method": "treePrototypes",
+ "areas": ["Memory"],
+ "description": "The property TerrainData.treePrototypes allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0188",
+ "type": "UnityEngine.TerrainData",
+ "method": "splatPrototypes",
+ "areas": ["Memory"],
+ "description": "The property TerrainData.splatPrototypes allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0189",
+ "type": "UnityEngine.TerrainData",
+ "method": "terrainLayers",
+ "areas": ["Memory"],
+ "description": "The property TerrainData.terrainLayers allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0190",
+ "type": "UnityEngine.Tilemaps.TileAnimationData",
+ "method": "animatedSprites",
+ "areas": ["Memory"],
+ "description": "The property Tilemaps.TileAnimationData.animatedSprites allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0191",
+ "type": "UnityEngine.UIElements.UxmlAttributeDescription",
+ "method": "obsoleteNames",
+ "areas": ["Memory"],
+ "description": "The property UIElements.UxmlAttributeDescription.obsoleteNames allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "minimumVersion": "2019.1"
+ },
+ {
+ "id": "PAC0200",
+ "type": "UnityEngine.Networking.IMultipartFormSection",
+ "method": "sectionData",
+ "areas": ["Memory"],
+ "description": "The property Networking.IMultipartFormSection.sectionData allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0201",
+ "type": "UnityEngine.Networking.MultipartFormDataSection",
+ "method": "sectionData",
+ "areas": ["Memory"],
+ "description": "The property Networking.MultipartFormDataSection.sectionData allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0202",
+ "type": "UnityEngine.Networking.MultipartFormFileSection",
+ "method": "sectionData",
+ "areas": ["Memory"],
+ "description": "The property Networking.MultipartFormFileSection.sectionData allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0203",
+ "type": "UnityEngine.WWWForm",
+ "method": "data",
+ "areas": ["Memory"],
+ "description": "The property WWWForm.data allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0204",
+ "type": "UnityEngine.Networking.DownloadHandler",
+ "method": "data",
+ "areas": ["Memory"],
+ "description": "The property Networking.DownloadHandler.data allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0208",
+ "type": "UnityEngine.Networking.UploadHandler",
+ "method": "data",
+ "areas": ["Memory"],
+ "description": "The property Networking.UploadHandler.data allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0215",
+ "type": "UnityEngine.Networking.NetworkMigrationManager",
+ "method": "peers",
+ "areas": ["Memory"],
+ "description": "The property Networking.NetworkMigrationManager.peers allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "maximumVersion": "2018.4"
+ },
+ {
+ "id": "PAC0216",
+ "type": "UnityEngine.Networking.NetworkServerSimple",
+ "method": "messageBuffer",
+ "areas": ["Memory"],
+ "description": "The property Networking.NetworkServerSimple.messageBuffer allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used.",
+ "maximumVersion": "2018.4"
+ },
+ {
+ "id": "PAC0217",
+ "type": "UnityEngine.WWW",
+ "method": "bytes",
+ "areas": ["Memory"],
+ "description": "The property WWW.bytes allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0219",
+ "type": "UnityEngine.XR.XRSettings",
+ "method": "supportedDevices",
+ "areas": ["Memory"],
+ "description": "The property XR.XRSettings.supportedDevices allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0220",
+ "type": "UnityEngine.TestTools.Constraints.AllocatingGCMemoryConstraint",
+ "method": "Arguments",
+ "areas": ["Memory"],
+ "description": "The property TestTools.Constraints.AllocatingGCMemoryConstraint.Arguments allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0221",
+ "type": "UnityEngine.TestTools.UnityPlatformAttribute",
+ "method": "include",
+ "areas": ["Memory"],
+ "description": "The property TestTools.UnityPlatformAttribute.include allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0222",
+ "type": "UnityEngine.TestTools.UnityPlatformAttribute",
+ "method": "exclude",
+ "areas": ["Memory"],
+ "description": "The property TestTools.UnityPlatformAttribute.exclude allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC0223",
+ "type": "UnityEngine.GameObject",
+ "method": "tag",
+ "areas": ["Memory"],
+ "description": "The GameObject.tag property allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Prefer using GameObject.CompareTag() instead, as this does not result in managed allocations."
+ },
+ {
+ "id": "PAC0224",
+ "type": "UnityEngine.Object",
+ "method": "Instantiate",
+ "areas": ["CPU","Memory"],
+ "description": "Creating Objects at runtime by calling Object.Instantiate can take a significant amount of CPU time and allocates managed memory.",
+ "solution": "Try to avoid calling Object.Instantiate in frequently-updated code. Consider implementing an Object Pool. The ObjectPool class is available from Unity 2021.1 as a convenience."
+ },
+ {
+ "id": "PAC0225",
+ "type": "UnityEngine.GameObject",
+ "method": "AddComponent",
+ "areas": ["CPU","Memory"],
+ "description": "Adding components to GameObjects at runtime can take a significant amount of CPU time and allocates managed memory.",
+ "solution": "Try to avoid adding or removing components in frequently-updated code. Prefer instantiating GameObjects from Prefabs will all the necessary components instead."
+ },
+ {
+ "id": "PAC0227",
+ "type": "UnityEngine.Shader",
+ "method": "WarmupAllShaders",
+ "areas": ["CPU"],
+ "defaultSeverity": 3,
+ "description": "WarmupAllShaders does not work properly on Metal, Vulkan or DX12. This might result in unexpected CPU spikes due to shader compilation.",
+ "solution": "Implement a shader pre-warming mechanism which renders a small triangle for each combination of vertex format and shader used at runtime. One way to achieve this is with the UnityEngine.Experimental.Rendering.ShaderWarmup API."
+ },
+ {
+ "id": "PAC0228",
+ "type": "UnityEngine.ShaderVariantCollection",
+ "method": "WarmUp",
+ "areas": ["CPU"],
+ "defaultSeverity": 3,
+ "description": "WarmUp does not work properly on Metal, Vulkan or DX12. This might result in unexpected CPU spikes due to shader compilation.",
+ "solution": "Implement a shader pre-warming mechanism which renders a small triangle for each combination of vertex format and shader variant used at runtime. One way to achieve this is with the UnityEngine.Experimental.Rendering.ShaderWarmup API."
+ },
+ {
+ "id": "PAC0229",
+ "type": "UnityEngine.Component",
+ "method": "tag",
+ "areas": ["Memory"],
+ "description": "The Component.tag property allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Prefer using CompareTag() instead, as this does not result in managed allocations."
+ },
+ {
+ "id": "PAC0231",
+ "type": "UnityEngine.Object",
+ "method": "name",
+ "areas": ["Memory"],
+ "description": "The Object.name property allocates managed memory.",
+ "solution": "Try to avoid getting this property in frequently-updated code. Ideally, this property should only be used during initialisation, and the results should be cached if they need to be re-used."
+ },
+ {
+ "id": "PAC1000",
+ "type": "System.Linq",
+ "method": "*",
+ "areas": ["CPU","Memory"],
+ "description": "Linq allocates large amounts of managed memory and exhibits poor CPU performance.",
+ "solution": "We strongly advise against using Linq in any frequently-updated code. Ban its usage from the project entirely, or confine it to initialization code and use it sparingly."
+ },
+ {
+ "id": "PAC1001",
+ "type": "System.Reflection",
+ "method": "*",
+ "areas": ["CPU"],
+ "description": "Reflection is slow, and not generally considered performant enough for runtime code.",
+ "solution": "Remove code which relies on reflection, or minimise its usage, particularly outside of initialization."
+ },
+ {
+ "id": "PAC1002",
+ "type": "System.String",
+ "method": "Concat",
+ "areas": ["Memory"],
+ "defaultSeverity": 5,
+ "description": "String concatenation operations allocates managed memory.",
+ "solution": "Try to avoid concatenating strings in frequently-updated code. Prefer using a StringBuilder instead, as this minimizes managed allocations."
+ },
+ {
+ "id": "PAC1003",
+ "type": "System.DateTime",
+ "method": "Now",
+ "areas": ["CPU"],
+ "description": "System.DateTime.Now can take a lot of CPU time because it needs to figure out the current timezone and daylight saving time information.",
+ "solution": "Try to avoid using this method in frequently-updated code. Prefer UnityEngine.Time.time or, if precise time is needed, use DateTime.UtcNow."
+ },
+ {
+ "id": "PAC1004",
+ "type": "System.AppDomain",
+ "method": "GetAssemblies",
+ "areas": ["CPU"],
+ "description": "System.AppDomain.GetAssemblies can take a lot of CPU time.",
+ "solution": "Try to minimize calls to System.AppDomain.GetAssemblies by caching the returned assemblies. When possible, use UnityEditor.TypeCache for fast access to types, methods and fields."
+ },
+ {
+ "id": "PAC0232",
+ "type": "UnityEditor.AssetDatabase",
+ "method": "FindAssets",
+ "areas": ["CPU"],
+ "description": "UnityEditor.AssetDatabase.FindAssets is a CPU-intensive operation and can slow down the Editor for long periods of time on large projects.",
+ "solution": "Try to minimize calls to UnityEditor.AssetDatabase.FindAssets."
+ },
+ {
+ "id": "PAC0234",
+ "type": "UnityEngine.Object",
+ "method": "FindObjectOfType",
+ "areas": ["CPU", "Memory"],
+ "description": "Object.FindObjectOfType() allocates managed memory and can be slow.",
+ "solution": "Try to avoid calling this method in frequently-updated code. Ideally, this method should only be used during initialisation, and the results should be cached if they need to be re-used."
+ }
+]
diff --git a/Data/ProjectSettings.json b/Data/ProjectSettings.json
index 711ab378a9..3502da78e1 100644
--- a/Data/ProjectSettings.json
+++ b/Data/ProjectSettings.json
@@ -1,122 +1,120 @@
-{
- "Items": [
- {
- "id": "PAS0000",
- "title": "Player: Metal API Validation is enabled",
- "type": "UnityEditor.PlayerSettings",
- "method": "enableMetalAPIValidation",
- "value": "True",
- "areas": ["CPU"],
- "platforms": ["iOS", "StandaloneOSX", "tvOS"],
- "description": "The Metal API Validation option is enabled in the iOS Player Settings. This option can negatively impact rendering performance in test builds, resulting in inaccurate profiling results.",
- "solution": "We recommend disabling Metal API Validation. This option will only affect builds running from Xcode, but it rarely highlights anything that the user will have control over.",
- "minimumVersion": "2018.1"
- },
- {
- "id": "PAS0001",
- "title": "Player: Graphics Jobs is disabled",
- "type": "UnityEditor.PlayerSettings",
- "method": "graphicsJobs",
- "value": "False",
- "areas": ["CPU"],
- "description": "The Graphics Jobs option in Player Settings is disabled. This may introduce CPU rendering performance bottlenecks.",
- "solution": "Try enabling Graphics Jobs and testing your application. This option spreads the task of building the render command buffer every frame across as many CPU cores as possible, rather than performing all the work in the render thread which is often a bottleneck. Performance will vary depending on the project.\n\nNote: This feature is experimental on specific Unity versions and may introduce new crashes. It is recommended to test accordingly."
- },
- {
- "id": "PAS0007",
- "title": "Player: Prebake Collision Meshes is disabled",
- "type": "UnityEditor.PlayerSettings",
- "method": "bakeCollisionMeshes",
- "value": "False",
- "areas": ["BuildSize","LoadTime"],
- "description": "The Prebake Collision Meshes option in Player Settings is disabled. This may result in longer application load times, although enabling the option may increase build times and sizes.",
- "solution": "If you are using physics in your application, consider enabling Prebake Collision Meshes, at least before creating release and profiling builds. Prebaked collision meshes can result in an increase in build times and sizes, but reduce loading/initialization times in your application, because serializing prebaked meshes is faster than baking them at runtime."
- },
- {
- "id": "PAS0008",
- "title": "Player: Optimize Mesh Data is disabled",
- "type": "UnityEditor.PlayerSettings",
- "method": "stripUnusedMeshComponents",
- "value": "False",
- "areas": ["BuildSize","LoadTime","GPU"],
- "description": "The Optimize Mesh Data option in Player Settings is disabled. Your project may be building and loading unused vertex channel information.",
- "solution": "Consider enabling Optimize Mesh Data. This option strips out vertex channels on meshes which are not used by the materials which are applied to them. This can reduce the file size of your meshes and the time to load them, and increase GPU rendering performance. It can, however, cause problems if mesh materials are changed at runtime, since the new materials might rely on vertex channels which have been removed, and it may contribute to longer build times."
- },
- {
- "id": "PAS0010",
- "title": "Player (WebGL): Data Caching is disabled",
- "type": "UnityEditor.PlayerSettings+WebGL",
- "method": "dataCaching",
- "value": "False",
- "areas": ["LoadTime"],
- "platforms": ["WebGL"],
- "description": "The Data Caching option in Player Settings is disabled. Asset data will be re-downloaded every time the content is loaded in a browser. This can increase load times.",
- "solution": "Enable Data Caching to cache build files in the browser cache."
- },
- {
- "id": "PAS0011",
- "title": "Player (WebGL): Linker Target is deprecated",
- "type": "UnityEditor.PlayerSettings+WebGL",
- "method": "linkerTarget",
- "value": "Asm",
- "areas": ["CPU","Memory"],
- "platforms": ["WebGL"],
- "description": "WebGLLinkerTarget.Asm linker target setting is deprecated.",
- "solution": "Set UnityEditor.PlayerSettings.WebGL.linkerTarget to WebGLLinkerTarget.Wasm to generate code in WebAssembly format.",
- "minimumVersion": "2018.1"
- },
- {
- "id": "PAS0012",
- "title": "Physics: Auto Sync Transforms is enabled",
- "type": "UnityEngine.Physics",
- "method": "autoSyncTransforms",
- "value": "True",
- "areas": ["CPU"],
- "description": "In Physics Settings, Auto Sync Transforms is enabled. This option ensures backwards compatibility with the behaviour of older versions of Unity in which physics transforms were always kept in sync with GameObject transforms. In newer versions of Unity, transform syncs are batched for greater efficiency on the CPU. Enabling this option means that transforms are always synced before physics queries (e.g. Physics.Raycast()); before reading data back from the physics engine (e.g. Rigidbody.position); before simulating particles that compute collisions, and before updating the camera flares effect. This adds an additional CPU cost.",
- "solution": "Consider disabling Auto Sync Transforms and testing your game to identify any areas where physics behavior is affected by the change. If there are areas of the game where more frequent synchronization is required to maintain the desired behaviour, this can be enforced by calling Physics.SyncTransforms() directly."
- },
- {
- "id": "PAS0014",
- "title": "Physics2D: Auto Sync Transforms is enabled",
- "type": "UnityEngine.Physics2D",
- "method": "autoSyncTransforms",
- "value": "True",
- "areas": ["CPU"],
- "description": "In Physics 2D Settings, Auto Sync Transforms is enabled. This option ensures backwards compatibility with the behaviour of older versions of Unity in which physics transforms were always kept in sync with GameObject transforms. In newer versions of Unity, transform syncs are batched for greater efficiency on the CPU. Enabling this option means that transforms are always synced before physics queries (e.g. Physics2D.Raycast()); before reading data back from the physics engine (e.g. Rigidbody2D.position); before simulating particles that compute collisions, and before updating the camera flares effect. This adds an additional CPU cost.",
- "solution": "Consider disabling Auto Sync Transforms and testing your game to identify any areas where physics behavior is affected by the change. If there are areas of the game where more frequent synchronization is required to maintain the desired behaviour, this can be enforced by calling Physics2D.SyncTransforms() directly."
- },
- {
- "id": "PAS0027",
- "title": "Player: Mipmap Stripping is disabled",
- "type": "UnityEditor.PlayerSettings",
- "method": "mipStripping",
- "value": "False",
- "areas": ["BuildSize"],
- "description": "The Texture MipMap Stripping option in Player Settings is disabled. As a result, the generated build might be larger than necessary.",
- "solution": "Enable Texture MipMap Stripping. Note that this feature will only reduce the build size if no quality levels on the platform use highest mip(s). Furthermore, if code drives the masterTextureLevel to a value higher than those in the quality level settings the mip will no longer be available if this is enabled.",
- "minimumVersion": "2020.2"
- },
- {
- "id": "PAS0028",
- "title": "Physics: Reuse Collision Callbacks is disabled",
- "type": "UnityEngine.Physics",
- "method": "reuseCollisionCallbacks",
- "value": "False",
- "areas": ["Memory"],
- "description": "The Reuse Collision Callbacks option in Physics Settings is disabled. For each OnCollision* callback, a temporary managed object is allocated.",
- "solution": "When this option is enabled, only a single instance of the Collision type is created and reused for each individual callback. This reduces waste for the garbage collector to handle and improves performance.",
- "minimumVersion": "2018.3"
- },
- {
- "id": "PAS0034",
- "title": "Player: Use incremental GC is disabled",
- "type": "UnityEditor.PlayerSettings",
- "method": "gcIncremental",
- "value": "False",
- "areas": ["CPU"],
- "description": "The Incremental Garbage Collection feature is disabled. This might lead to CPU spikes due to Garbage Collection.",
- "solution": "To enable this feature, enable option Project Settings > Player > Other Settings > Configuration > Use incremental GC. Note this is not a substitute for reducing per-frame managed allocations.",
- "minimumVersion": "2019.1"
- }
- ]
-}
+[
+ {
+ "id": "PAS0000",
+ "title": "Player: Metal API Validation is enabled",
+ "type": "UnityEditor.PlayerSettings",
+ "method": "enableMetalAPIValidation",
+ "value": "True",
+ "areas": ["CPU"],
+ "platforms": ["iOS", "StandaloneOSX", "tvOS"],
+ "description": "The Metal API Validation option is enabled in the iOS Player Settings. This option can negatively impact rendering performance in test builds, resulting in inaccurate profiling results.",
+ "solution": "We recommend disabling Metal API Validation. This option will only affect builds running from Xcode, but it rarely highlights anything that the user will have control over.",
+ "minimumVersion": "2018.1"
+ },
+ {
+ "id": "PAS0001",
+ "title": "Player: Graphics Jobs is disabled",
+ "type": "UnityEditor.PlayerSettings",
+ "method": "graphicsJobs",
+ "value": "False",
+ "areas": ["CPU"],
+ "description": "The Graphics Jobs option in Player Settings is disabled. This may introduce CPU rendering performance bottlenecks.",
+ "solution": "Try enabling Graphics Jobs and testing your application. This option spreads the task of building the render command buffer every frame across as many CPU cores as possible, rather than performing all the work in the render thread which is often a bottleneck. Performance will vary depending on the project.\n\nNote: This feature is experimental on specific Unity versions and may introduce new crashes. It is recommended to test accordingly."
+ },
+ {
+ "id": "PAS0007",
+ "title": "Player: Prebake Collision Meshes is disabled",
+ "type": "UnityEditor.PlayerSettings",
+ "method": "bakeCollisionMeshes",
+ "value": "False",
+ "areas": ["BuildSize","LoadTime"],
+ "description": "The Prebake Collision Meshes option in Player Settings is disabled. This may result in longer application load times, although enabling the option may increase build times and sizes.",
+ "solution": "If you are using physics in your application, consider enabling Prebake Collision Meshes, at least before creating release and profiling builds. Prebaked collision meshes can result in an increase in build times and sizes, but reduce loading/initialization times in your application, because serializing prebaked meshes is faster than baking them at runtime."
+ },
+ {
+ "id": "PAS0008",
+ "title": "Player: Optimize Mesh Data is disabled",
+ "type": "UnityEditor.PlayerSettings",
+ "method": "stripUnusedMeshComponents",
+ "value": "False",
+ "areas": ["BuildSize","LoadTime","GPU"],
+ "description": "The Optimize Mesh Data option in Player Settings is disabled. Your project may be building and loading unused vertex channel information.",
+ "solution": "Consider enabling Optimize Mesh Data. This option strips out vertex channels on meshes which are not used by the materials which are applied to them. This can reduce the file size of your meshes and the time to load them, and increase GPU rendering performance. It can, however, cause problems if mesh materials are changed at runtime, since the new materials might rely on vertex channels which have been removed, and it may contribute to longer build times."
+ },
+ {
+ "id": "PAS0010",
+ "title": "Player (WebGL): Data Caching is disabled",
+ "type": "UnityEditor.PlayerSettings+WebGL",
+ "method": "dataCaching",
+ "value": "False",
+ "areas": ["LoadTime"],
+ "platforms": ["WebGL"],
+ "description": "The Data Caching option in Player Settings is disabled. Asset data will be re-downloaded every time the content is loaded in a browser. This can increase load times.",
+ "solution": "Enable Data Caching to cache build files in the browser cache."
+ },
+ {
+ "id": "PAS0011",
+ "title": "Player (WebGL): Linker Target is deprecated",
+ "type": "UnityEditor.PlayerSettings+WebGL",
+ "method": "linkerTarget",
+ "value": "Asm",
+ "areas": ["CPU","Memory"],
+ "platforms": ["WebGL"],
+ "description": "WebGLLinkerTarget.Asm linker target setting is deprecated.",
+ "solution": "Set UnityEditor.PlayerSettings.WebGL.linkerTarget to WebGLLinkerTarget.Wasm to generate code in WebAssembly format.",
+ "minimumVersion": "2018.1"
+ },
+ {
+ "id": "PAS0012",
+ "title": "Physics: Auto Sync Transforms is enabled",
+ "type": "UnityEngine.Physics",
+ "method": "autoSyncTransforms",
+ "value": "True",
+ "areas": ["CPU"],
+ "description": "In Physics Settings, Auto Sync Transforms is enabled. This option ensures backwards compatibility with the behaviour of older versions of Unity in which physics transforms were always kept in sync with GameObject transforms. In newer versions of Unity, transform syncs are batched for greater efficiency on the CPU. Enabling this option means that transforms are always synced before physics queries (e.g. Physics.Raycast()); before reading data back from the physics engine (e.g. Rigidbody.position); before simulating particles that compute collisions, and before updating the camera flares effect. This adds an additional CPU cost.",
+ "solution": "Consider disabling Auto Sync Transforms and testing your game to identify any areas where physics behavior is affected by the change. If there are areas of the game where more frequent synchronization is required to maintain the desired behaviour, this can be enforced by calling Physics.SyncTransforms() directly."
+ },
+ {
+ "id": "PAS0014",
+ "title": "Physics2D: Auto Sync Transforms is enabled",
+ "type": "UnityEngine.Physics2D",
+ "method": "autoSyncTransforms",
+ "value": "True",
+ "areas": ["CPU"],
+ "description": "In Physics 2D Settings, Auto Sync Transforms is enabled. This option ensures backwards compatibility with the behaviour of older versions of Unity in which physics transforms were always kept in sync with GameObject transforms. In newer versions of Unity, transform syncs are batched for greater efficiency on the CPU. Enabling this option means that transforms are always synced before physics queries (e.g. Physics2D.Raycast()); before reading data back from the physics engine (e.g. Rigidbody2D.position); before simulating particles that compute collisions, and before updating the camera flares effect. This adds an additional CPU cost.",
+ "solution": "Consider disabling Auto Sync Transforms and testing your game to identify any areas where physics behavior is affected by the change. If there are areas of the game where more frequent synchronization is required to maintain the desired behaviour, this can be enforced by calling Physics2D.SyncTransforms() directly."
+ },
+ {
+ "id": "PAS0027",
+ "title": "Player: Mipmap Stripping is disabled",
+ "type": "UnityEditor.PlayerSettings",
+ "method": "mipStripping",
+ "value": "False",
+ "areas": ["BuildSize"],
+ "description": "The Texture MipMap Stripping option in Player Settings is disabled. As a result, the generated build might be larger than necessary.",
+ "solution": "Enable Texture MipMap Stripping. Note that this feature will only reduce the build size if no quality levels on the platform use highest mip(s). Furthermore, if code drives the masterTextureLevel to a value higher than those in the quality level settings the mip will no longer be available if this is enabled.",
+ "minimumVersion": "2020.2"
+ },
+ {
+ "id": "PAS0028",
+ "title": "Physics: Reuse Collision Callbacks is disabled",
+ "type": "UnityEngine.Physics",
+ "method": "reuseCollisionCallbacks",
+ "value": "False",
+ "areas": ["Memory"],
+ "description": "The Reuse Collision Callbacks option in Physics Settings is disabled. For each OnCollision* callback, a temporary managed object is allocated.",
+ "solution": "When this option is enabled, only a single instance of the Collision type is created and reused for each individual callback. This reduces waste for the garbage collector to handle and improves performance.",
+ "minimumVersion": "2018.3"
+ },
+ {
+ "id": "PAS0034",
+ "title": "Player: Use incremental GC is disabled",
+ "type": "UnityEditor.PlayerSettings",
+ "method": "gcIncremental",
+ "value": "False",
+ "areas": ["CPU"],
+ "description": "The Incremental Garbage Collection feature is disabled. This might lead to CPU spikes due to Garbage Collection.",
+ "solution": "To enable this feature, enable option Project Settings > Player > Other Settings > Configuration > Use incremental GC. Note this is not a substitute for reducing per-frame managed allocations.",
+ "minimumVersion": "2019.1"
+ }
+]
diff --git a/Data/RoslynTextLookup.json b/Data/RoslynTextLookup.json
index c18ab84bd4..9544acf83c 100644
--- a/Data/RoslynTextLookup.json
+++ b/Data/RoslynTextLookup.json
@@ -1,19 +1,17 @@
-{
- "Items": [
- {
- "id": "UDR0001",
- "description": "This script contains static fields, but does not contain a method with the [RuntimeInitializeOnLoadMethod] attribute. If Domain Reload is disabled to facilitate faster entering/exiting Play Mode, the values in the static fields will not be reset.",
- "solution": "Create a method with a [RuntimeInitializeOnLoadMethod] attribute and ensure that all static variables are assigned values in this method."
- },
- {
- "id": "UDR0002",
- "description": "This script contains one or more static fields and a method with the [RuntimeInitializeOnLoadMethod] attribute, but the method does not set the value of the field(s). If Domain Reload is disabled to facilitate faster entering/exiting Play Mode, the values in the static fields will not be reset.",
- "solution": "Ensure that the method with a [RuntimeInitializeOnLoadMethod] attribute assigns values to all static variables declared in this class."
- },
- {
- "id": "UDR0003",
- "description": "This script contains one or more static events, but not all of the delegates are subscribed to the event are explicitly unsubscribed when leaving Play Mode. If Domain Reload is disabled to facilitate faster entering/exiting Play Mode, the event may end up with multiple duplicate registered delegates.",
- "solution": "Unsubscribe callbacks from static events when they are no longer needed. This could be in a MonoBehaviour.OnApplicationQuit() or MonoBehaviour.OnDestroy() method, for example."
- }
- ]
-}
+[
+ {
+ "id": "UDR0001",
+ "description": "This script contains static fields, but does not contain a method with the [RuntimeInitializeOnLoadMethod] attribute. If Domain Reload is disabled to facilitate faster entering/exiting Play Mode, the values in the static fields will not be reset.",
+ "solution": "Create a method with a [RuntimeInitializeOnLoadMethod] attribute and ensure that all static variables are assigned values in this method."
+ },
+ {
+ "id": "UDR0002",
+ "description": "This script contains one or more static fields and a method with the [RuntimeInitializeOnLoadMethod] attribute, but the method does not set the value of the field(s). If Domain Reload is disabled to facilitate faster entering/exiting Play Mode, the values in the static fields will not be reset.",
+ "solution": "Ensure that the method with a [RuntimeInitializeOnLoadMethod] attribute assigns values to all static variables declared in this class."
+ },
+ {
+ "id": "UDR0003",
+ "description": "This script contains one or more static events, but not all of the delegates are subscribed to the event are explicitly unsubscribed when leaving Play Mode. If Domain Reload is disabled to facilitate faster entering/exiting Play Mode, the event may end up with multiple duplicate registered delegates.",
+ "solution": "Unsubscribe callbacks from static events when they are no longer needed. This could be in a MonoBehaviour.OnApplicationQuit() or MonoBehaviour.OnDestroy() method, for example."
+ }
+]
diff --git a/Editor/Core/AnalysisContext.cs b/Editor/Core/AnalysisContext.cs
index c86df2cab1..8bfdf8fefa 100644
--- a/Editor/Core/AnalysisContext.cs
+++ b/Editor/Core/AnalysisContext.cs
@@ -34,11 +34,11 @@ public bool IsDescriptorEnabled(Descriptor descriptor)
if (!descriptor.IsApplicable(Params))
return false;
- var rule = Params.Rules.GetRule(descriptor.id);
+ var rule = Params.Rules.GetRule(descriptor.Id);
if (rule != null)
return rule.severity != Severity.None;
- return descriptor.isEnabledByDefault;
+ return descriptor.IsEnabledByDefault;
}
}
}
diff --git a/Editor/Core/Module.cs b/Editor/Core/Module.cs
index 9ee9b6ae1f..6cf12be57c 100644
--- a/Editor/Core/Module.cs
+++ b/Editor/Core/Module.cs
@@ -62,10 +62,10 @@ public void RegisterDescriptor(Descriptor descriptor)
if (!descriptor.IsVersionCompatible())
return;
- DescriptorLibrary.RegisterDescriptor(descriptor.id, descriptor);
+ DescriptorLibrary.RegisterDescriptor(descriptor.Id, descriptor);
- if (!m_Ids.Add(descriptor.id))
- throw new Exception("Duplicate descriptor with id: " + descriptor.id);
+ if (!m_Ids.Add(descriptor.Id))
+ throw new Exception("Duplicate descriptor with id: " + descriptor.Id);
}
public bool SupportsDescriptor(DescriptorID id)
diff --git a/Editor/Diagnostic/Descriptor.cs b/Editor/Diagnostic/Descriptor.cs
index edefe15c83..66467fed77 100644
--- a/Editor/Diagnostic/Descriptor.cs
+++ b/Editor/Diagnostic/Descriptor.cs
@@ -1,7 +1,7 @@
using System;
using System.Linq;
-using System.Runtime.CompilerServices;
using Newtonsoft.Json;
+using UnityEngine.Serialization;
namespace Unity.ProjectAuditor.Editor.Diagnostic
{
@@ -14,80 +14,62 @@ public sealed class Descriptor : IEquatable
///
/// An unique identifier for the diagnostic. IDs must have exactly 3 upper case characters, followed by 4 digits
///
- [JsonRequired]
- public string id;
+ public string Id;
///
/// Diagnostic title
///
- [JsonRequired]
- public string title;
+ public string Title;
///
/// Message used to describe a specific instance of the diagnostic
///
- [JsonIgnore]
- public string messageFormat;
+ public string MessageFormat;
///
/// Default severity of the diagnostic
///
- [JsonIgnore]
- public Severity defaultSeverity;
+ public Severity DefaultSeverity;
///
/// Returns true if the diagnostic is enabled by default.
///
- public bool isEnabledByDefault = true;
+ public bool IsEnabledByDefault = true;
///
/// Affected areas
///
- [JsonRequired]
- public string[] areas;
+ public string[] Areas;
///
/// Affected platforms. If null, the diagnostic applies to all platforms
///
- [JsonProperty]
- public string[] platforms;
+ public string[] Platforms;
///
/// Description of the diagnostic
///
- [JsonRequired]
- public string description;
+ public string Description;
///
/// Recommendation to fix the diagnostic
///
- [JsonRequired]
- public string solution;
+ public string Solution;
///
/// Url to documentation
///
- [JsonIgnore]
- public string documentationUrl;
-
- [JsonProperty("documentationUrl")]
- internal string documentationUrlForJson
- {
- get => string.IsNullOrEmpty(documentationUrl) ? null : documentationUrl;
- set => documentationUrl = string.IsNullOrEmpty(value) ? String.Empty : value;
- }
+ public string DocumentationUrl;
///
/// Minimum Unity version this diagnostic applies to. If not specified, the diagnostic applies to all versions
///
- [JsonIgnore]
- public string minimumVersion;
+ public string MinimumVersion;
///
/// Maximum Unity version this diagnostic applies to. If not specified, the diagnostic applies to all versions
///
- [JsonIgnore]
- public string maximumVersion;
+ public string MaximumVersion;
///
/// Optional Auto-fixer
@@ -98,20 +80,17 @@ internal string documentationUrlForJson
///
/// Name of the type (namespace and class/struct) of a known code API issue
///
- [JsonIgnore]
- public string type;
+ public string Type;
///
/// Name of the method of a known code API issue
///
- [JsonIgnore]
- public string method;
+ public string Method;
///
/// The evaluated value of a know code API issue
///
- [JsonIgnore]
- public string value;
+ public string Value;
[JsonConstructor]
internal Descriptor()
@@ -129,16 +108,16 @@ internal Descriptor()
/// Advice on how to resolve the issue.
public Descriptor(string id, string title, string[] areas, string description, string solution)
{
- this.id = id;
- this.title = title;
- this.areas = areas;
- this.messageFormat = string.Empty;
- this.description = description;
- this.solution = solution;
-
- type = string.Empty;
- method = string.Empty;
- defaultSeverity = Severity.Moderate;
+ Id = id;
+ Title = title;
+ Areas = areas;
+ MessageFormat = string.Empty;
+ Description = description;
+ Solution = solution;
+
+ Type = string.Empty;
+ Method = string.Empty;
+ DefaultSeverity = Severity.Moderate;
}
///
@@ -174,7 +153,7 @@ public bool Equals(Descriptor other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
- return id == other.id;
+ return Id == other.Id;
}
/// Returns true if the Descriptor is equal to a given object, false otherwise.
@@ -202,7 +181,7 @@ internal void Fix(ProjectIssue issue)
/// The computed hash code.
public override int GetHashCode()
{
- return id.GetHashCode();
+ return Id.GetHashCode();
}
}
}
diff --git a/Editor/Diagnostic/DescriptorExtensions.cs b/Editor/Diagnostic/DescriptorExtensions.cs
index 0273e03f90..1048f6951e 100644
--- a/Editor/Diagnostic/DescriptorExtensions.cs
+++ b/Editor/Diagnostic/DescriptorExtensions.cs
@@ -11,22 +11,22 @@ internal static class DescriptorExtensions
{
public static Area[] GetAreas(this Descriptor descriptor)
{
- return descriptor.areas.Select(a => (Area)Enum.Parse(typeof(Area), a)).ToArray();
+ return descriptor.Areas.Select(a => (Area)Enum.Parse(typeof(Area), a)).ToArray();
}
public static string GetAreasSummary(this Descriptor descriptor)
{
- return Formatting.CombineStrings(descriptor.areas);
+ return Formatting.CombineStrings(descriptor.Areas);
}
public static string GetPlatformsSummary(this Descriptor descriptor)
{
- return (descriptor.platforms == null || descriptor.platforms.Length == 0) ? "Any" : Formatting.CombineStrings(descriptor.platforms);
+ return (descriptor.Platforms == null || descriptor.Platforms.Length == 0) ? "Any" : Formatting.CombineStrings(descriptor.Platforms);
}
public static string GetFullTypeName(this Descriptor descriptor)
{
- return descriptor.type + "." + descriptor.method;
+ return descriptor.Type + "." + descriptor.Method;
}
///
@@ -34,9 +34,9 @@ public static string GetFullTypeName(this Descriptor descriptor)
///
public static bool IsPlatformCompatible(this Descriptor descriptor, BuildTarget buildTarget)
{
- if (descriptor.platforms == null || descriptor.platforms.Length == 0)
+ if (descriptor.Platforms == null || descriptor.Platforms.Length == 0)
return true;
- return descriptor.platforms.Contains(buildTarget.ToString());
+ return descriptor.Platforms.Contains(buildTarget.ToString());
}
public static bool IsApplicable(this Descriptor desc, AnalysisParams analysisParams)
@@ -49,7 +49,7 @@ public static bool IsApplicable(this Descriptor desc, AnalysisParams analysisPar
///
public static bool IsPlatformSupported(this Descriptor desc)
{
- var platforms = desc.platforms;
+ var platforms = desc.Platforms;
if (platforms == null)
return true;
foreach (var platform in platforms)
@@ -68,9 +68,9 @@ public static bool IsPlatformSupported(this Descriptor desc)
///
public static bool IsPlatformSpecific(this Descriptor descriptor, BuildTarget buildTarget)
{
- if (descriptor.platforms == null || descriptor.platforms.Length != 1)
+ if (descriptor.Platforms == null || descriptor.Platforms.Length != 1)
return false;
- return descriptor.platforms[0].Equals(buildTarget.ToString());
+ return descriptor.Platforms[0].Equals(buildTarget.ToString());
}
static Version s_UnityVersion = (Version)null;
@@ -91,33 +91,33 @@ public static bool IsVersionCompatible(this Descriptor desc)
var minimumVersion = (Version)null;
var maximumVersion = (Version)null;
- if (!string.IsNullOrEmpty(desc.minimumVersion))
+ if (!string.IsNullOrEmpty(desc.MinimumVersion))
{
try
{
- minimumVersion = new Version(desc.minimumVersion);
+ minimumVersion = new Version(desc.MinimumVersion);
}
catch (Exception exception)
{
- Debug.LogErrorFormat("Descriptor ({0}) minimumVersion ({1}) is invalid. Exception: {2}", desc.id, desc.minimumVersion, exception.Message);
+ Debug.LogErrorFormat("Descriptor ({0}) minimumVersion ({1}) is invalid. Exception: {2}", desc.Id, desc.MinimumVersion, exception.Message);
}
}
- if (!string.IsNullOrEmpty(desc.maximumVersion))
+ if (!string.IsNullOrEmpty(desc.MaximumVersion))
{
try
{
- maximumVersion = new Version(desc.maximumVersion);
+ maximumVersion = new Version(desc.MaximumVersion);
}
catch (Exception exception)
{
- Debug.LogErrorFormat("Descriptor ({0}) maximumVersion ({1}) is invalid. Exception: {2}", desc.id, desc.maximumVersion, exception.Message);
+ Debug.LogErrorFormat("Descriptor ({0}) maximumVersion ({1}) is invalid. Exception: {2}", desc.Id, desc.MaximumVersion, exception.Message);
}
}
if (minimumVersion != null && maximumVersion != null && minimumVersion > maximumVersion)
{
- Debug.LogErrorFormat("Descriptor ({0}) minimumVersion ({1}) is greater than maximumVersion ({2}).", desc.id, minimumVersion, maximumVersion);
+ Debug.LogErrorFormat("Descriptor ({0}) minimumVersion ({1}) is greater than maximumVersion ({2}).", desc.Id, minimumVersion, maximumVersion);
return false;
}
diff --git a/Editor/Diagnostic/DescriptorJsonConverter.cs b/Editor/Diagnostic/DescriptorJsonConverter.cs
new file mode 100644
index 0000000000..237edae56b
--- /dev/null
+++ b/Editor/Diagnostic/DescriptorJsonConverter.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
+namespace Unity.ProjectAuditor.Editor.Diagnostic
+{
+ public class DescriptorJsonConverter : JsonConverter
+ {
+ public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
+ {
+ var token = JToken.FromObject(value);
+ if (token.Type != JTokenType.Object)
+ {
+ token.WriteTo(writer);
+ return;
+ }
+
+ // remove properties that are not needed in the report
+ var removeProperties = new List()
+ {
+ nameof(Descriptor.DefaultSeverity),
+ nameof(Descriptor.IsEnabledByDefault),
+ nameof(Descriptor.MessageFormat),
+ nameof(Descriptor.Type),
+ nameof(Descriptor.Method),
+ nameof(Descriptor.Value),
+ nameof(Descriptor.MinimumVersion),
+ nameof(Descriptor.MaximumVersion)
+ };
+
+ var obj = (JObject)token;
+ var newObj = new JObject();
+ foreach (var property in obj.Properties())
+ {
+ if (removeProperties.Contains(property.Name))
+ continue;
+
+ if (property.Value.Type == JTokenType.Null)
+ continue;
+
+ if (property.Value.Type == JTokenType.String && string.IsNullOrEmpty(property.Value.ToString()))
+ continue;
+
+ var camelCaseName = ConvertToCamelCase(property.Name);
+ newObj[camelCaseName] = property.Value;
+ }
+
+ // Write the camelCase JObject to the writer
+ newObj.WriteTo(writer);
+ }
+
+ public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
+ {
+ return serializer.Deserialize(reader, objectType);
+ }
+
+ public override bool CanConvert(Type objectType)
+ {
+ return objectType == typeof(Descriptor);
+ }
+
+ string ConvertToCamelCase(string name)
+ {
+ if (string.IsNullOrEmpty(name) || !char.IsUpper(name[0]))
+ {
+ return name;
+ }
+
+ var camelCaseName = char.ToLowerInvariant(name[0]) + name.Substring(1);
+ return camelCaseName;
+ }
+ }
+}
diff --git a/Editor/Diagnostic/DescriptorJsonConverter.cs.meta b/Editor/Diagnostic/DescriptorJsonConverter.cs.meta
new file mode 100644
index 0000000000..43420c82f9
--- /dev/null
+++ b/Editor/Diagnostic/DescriptorJsonConverter.cs.meta
@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 6f41b53f76644b538d749f1ef98d9836
+timeCreated: 1699972466
\ No newline at end of file
diff --git a/Editor/Diagnostic/DescriptorLibrary.cs b/Editor/Diagnostic/DescriptorLibrary.cs
index 92b7d7da1c..6d9dabb588 100644
--- a/Editor/Diagnostic/DescriptorLibrary.cs
+++ b/Editor/Diagnostic/DescriptorLibrary.cs
@@ -54,7 +54,7 @@ public void OnAfterDeserialize()
// edge case that it doesn't really seem worth spending time on.
if (m_SerializedDescriptors != null)
{
- s_Descriptors = m_SerializedDescriptors.ToDictionary(m => new DescriptorID(m.id).AsInt(), m => m);
+ s_Descriptors = m_SerializedDescriptors.ToDictionary(m => new DescriptorID(m.Id).AsInt(), m => m);
m_SerializedDescriptors = null;
}
}
diff --git a/Editor/Diagnostic/DescriptorLoader.cs b/Editor/Diagnostic/DescriptorLoader.cs
index f0f7cd66d8..47029336b1 100644
--- a/Editor/Diagnostic/DescriptorLoader.cs
+++ b/Editor/Diagnostic/DescriptorLoader.cs
@@ -13,23 +13,26 @@ internal static List LoadFromJson(string path, string name)
var descriptors = new List(rawDescriptors.Length);
foreach (var rawDescriptor in rawDescriptors)
{
- var desc = new Descriptor(rawDescriptor.id, rawDescriptor.title, rawDescriptor.areas, rawDescriptor.description, rawDescriptor.solution)
+ if (string.IsNullOrEmpty(rawDescriptor.Id))
+ throw new Exception("Descriptor with null id loaded from " + name);
+
+ var desc = new Descriptor(rawDescriptor.Id, rawDescriptor.Title, rawDescriptor.Areas, rawDescriptor.Description, rawDescriptor.Solution)
{
- type = rawDescriptor.type ?? string.Empty,
- method = rawDescriptor.method ?? string.Empty,
- value = rawDescriptor.value,
- platforms = rawDescriptor.platforms,
- defaultSeverity = rawDescriptor.defaultSeverity == Severity.Default ? Severity.Moderate : rawDescriptor.defaultSeverity,
- documentationUrl = rawDescriptor.documentationUrl ?? string.Empty,
- minimumVersion = rawDescriptor.minimumVersion ?? string.Empty,
- maximumVersion = rawDescriptor.maximumVersion ?? string.Empty
+ Type = rawDescriptor.Type ?? string.Empty,
+ Method = rawDescriptor.Method ?? string.Empty,
+ Value = rawDescriptor.Value,
+ Platforms = rawDescriptor.Platforms,
+ DefaultSeverity = rawDescriptor.DefaultSeverity == Severity.Default ? Severity.Moderate : rawDescriptor.DefaultSeverity,
+ DocumentationUrl = rawDescriptor.DocumentationUrl ?? string.Empty,
+ MinimumVersion = rawDescriptor.MinimumVersion ?? string.Empty,
+ MaximumVersion = rawDescriptor.MaximumVersion ?? string.Empty
};
- if (string.IsNullOrEmpty(desc.title))
+ if (string.IsNullOrEmpty(desc.Title))
{
- if (string.IsNullOrEmpty(desc.type) || string.IsNullOrEmpty(desc.method))
- desc.title = string.Empty;
+ if (string.IsNullOrEmpty(desc.Type) || string.IsNullOrEmpty(desc.Method))
+ desc.Title = string.Empty;
else
- desc.title = desc.GetFullTypeName();
+ desc.Title = desc.GetFullTypeName();
}
descriptors.Add(desc);
diff --git a/Editor/InstructionAnalyzers/AllocationAnalyzer.cs b/Editor/InstructionAnalyzers/AllocationAnalyzer.cs
index 71b243da90..507d9eb753 100644
--- a/Editor/InstructionAnalyzers/AllocationAnalyzer.cs
+++ b/Editor/InstructionAnalyzers/AllocationAnalyzer.cs
@@ -27,8 +27,8 @@ class AllocationAnalyzer : ICodeModuleInstructionAnalyzer
"Try to avoid allocating objects in frequently-updated code."
)
{
- messageFormat = "'{0}' allocation",
- defaultSeverity = Severity.Minor
+ MessageFormat = "'{0}' allocation",
+ DefaultSeverity = Severity.Minor
};
static readonly Descriptor k_ClosureAllocationDescriptor = new Descriptor
@@ -40,8 +40,8 @@ class AllocationAnalyzer : ICodeModuleInstructionAnalyzer
"Try to avoid allocating objects in frequently-updated code."
)
{
- messageFormat = "Closure allocation in '{0}.{1}'",
- defaultSeverity = Severity.Minor
+ MessageFormat = "Closure allocation in '{0}.{1}'",
+ DefaultSeverity = Severity.Minor
};
static readonly Descriptor k_ArrayAllocationDescriptor = new Descriptor
@@ -53,8 +53,8 @@ class AllocationAnalyzer : ICodeModuleInstructionAnalyzer
"Try to avoid allocating arrays in frequently-updated code."
)
{
- messageFormat = "'{0}' array allocation",
- defaultSeverity = Severity.Minor
+ MessageFormat = "'{0}' array allocation",
+ DefaultSeverity = Severity.Minor
};
static readonly Descriptor k_ParamArrayAllocationDescriptor = new Descriptor
@@ -66,7 +66,7 @@ class AllocationAnalyzer : ICodeModuleInstructionAnalyzer
"Try to avoid calling this method in frequently-updated code."
)
{
- messageFormat = "Parameters array '{0} {1}' allocation"
+ MessageFormat = "Parameters array '{0} {1}' allocation"
};
static readonly int k_ParamArrayAtributeHashCode = "System.ParamArrayAttribute".GetHashCode();
@@ -99,7 +99,7 @@ public IssueBuilder Analyze(InstructionAnalysisContext context)
var lastParam = callee.Parameters.Last();
if (lastParam.HasCustomAttributes && lastParam.CustomAttributes.Any(a => a.AttributeType.FullName.GetHashCode() == k_ParamArrayAtributeHashCode))
{
- return context.Create(IssueCategory.Code, k_ParamArrayAllocationDescriptor.id, lastParam.ParameterType.Name, lastParam.Name);
+ return context.Create(IssueCategory.Code, k_ParamArrayAllocationDescriptor.Id, lastParam.ParameterType.Name, lastParam.Name);
}
}
return null;
@@ -115,18 +115,18 @@ public IssueBuilder Analyze(InstructionAnalysisContext context)
var isClosure = typeReference.Name.StartsWith("<>c__DisplayClass");
if (isClosure)
{
- return context.Create(IssueCategory.Code, k_ClosureAllocationDescriptor.id, context.MethodDefinition.DeclaringType.Name, context.MethodDefinition.Name);
+ return context.Create(IssueCategory.Code, k_ClosureAllocationDescriptor.Id, context.MethodDefinition.DeclaringType.Name, context.MethodDefinition.Name);
}
else
{
- return context.Create(IssueCategory.Code, k_ObjectAllocationDescriptor.id, typeReference.FullName);
+ return context.Create(IssueCategory.Code, k_ObjectAllocationDescriptor.Id, typeReference.FullName);
}
}
else // OpCodes.Newarr
{
var typeReference = (TypeReference)context.Instruction.Operand;
- return context.Create(IssueCategory.Code, k_ArrayAllocationDescriptor.id, typeReference.Name);
+ return context.Create(IssueCategory.Code, k_ArrayAllocationDescriptor.Id, typeReference.Name);
}
}
}
diff --git a/Editor/InstructionAnalyzers/BoxingAnalyzer.cs b/Editor/InstructionAnalyzers/BoxingAnalyzer.cs
index fd2ca250cb..b2d1bee850 100644
--- a/Editor/InstructionAnalyzers/BoxingAnalyzer.cs
+++ b/Editor/InstructionAnalyzers/BoxingAnalyzer.cs
@@ -22,8 +22,8 @@ class BoxingAnalyzer : ICodeModuleInstructionAnalyzer
"Try to avoid boxing when possible. Create methods and APIs that can accept value types."
)
{
- documentationUrl = "https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/boxing-and-unboxing",
- messageFormat = "Conversion from value type '{0}' to ref type"
+ DocumentationUrl = "https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/types/boxing-and-unboxing",
+ MessageFormat = "Conversion from value type '{0}' to ref type"
};
readonly OpCode[] m_OpCodes =
@@ -62,7 +62,7 @@ public IssueBuilder Analyze(InstructionAnalysisContext context)
else if (type.FullName.Equals("System.Double"))
typeName = "double";
- return context.Create(IssueCategory.Code, k_Descriptor.id, typeName);
+ return context.Create(IssueCategory.Code, k_Descriptor.Id, typeName);
}
}
}
diff --git a/Editor/InstructionAnalyzers/BuiltinCallAnalyzer.cs b/Editor/InstructionAnalyzers/BuiltinCallAnalyzer.cs
index 30b839acce..f01eb0f602 100644
--- a/Editor/InstructionAnalyzers/BuiltinCallAnalyzer.cs
+++ b/Editor/InstructionAnalyzers/BuiltinCallAnalyzer.cs
@@ -33,21 +33,21 @@ public void Initialize(Module module)
}
var methodDescriptors = descriptors.Where(
- descriptor => !descriptor.method.Equals("*") &&
- !string.IsNullOrEmpty(descriptor.type) &&
- module.SupportsDescriptor(descriptor.id));
+ descriptor => !descriptor.Method.Equals("*") &&
+ !string.IsNullOrEmpty(descriptor.Type) &&
+ module.SupportsDescriptor(descriptor.Id));
m_Descriptors = new Dictionary>();
foreach (var d in methodDescriptors)
{
- if (!m_Descriptors.ContainsKey(d.method))
+ if (!m_Descriptors.ContainsKey(d.Method))
{
- m_Descriptors.Add(d.method, new List());
+ m_Descriptors.Add(d.Method, new List());
}
- m_Descriptors[d.method].Add(d);
+ m_Descriptors[d.Method].Add(d);
}
- m_NamespaceOrClassDescriptors = descriptors.Where(descriptor => descriptor.method.Equals("*")).ToDictionary(d => d.type);
+ m_NamespaceOrClassDescriptors = descriptors.Where(descriptor => descriptor.Method.Equals("*")).ToDictionary(d => d.Type);
}
public IssueBuilder Analyze(InstructionAnalysisContext context)
@@ -78,24 +78,24 @@ public IssueBuilder Analyze(InstructionAnalysisContext context)
return null;
Profiler.BeginSample("BuiltinCallAnalyzer.FindDescriptor");
- descriptor = descriptors.Find(d => MonoCecilHelper.IsOrInheritedFrom(declaringType, d.type));
+ descriptor = descriptors.Find(d => MonoCecilHelper.IsOrInheritedFrom(declaringType, d.Type));
Profiler.EndSample();
if (descriptor == null)
return null;
// by default use descriptor issue description
- description = string.Format("'{0}' usage", descriptor.title);
+ description = string.Format("'{0}' usage", descriptor.Title);
var genericInstanceMethod = callee as GenericInstanceMethod;
if (genericInstanceMethod != null && genericInstanceMethod.HasGenericArguments)
{
var genericTypeNames = genericInstanceMethod.GenericArguments.Select(a => a.FullName).ToArray();
- description = string.Format("'{0}' usage (with generic argument '{1}')", descriptor.title, string.Join(", ", genericTypeNames));
+ description = string.Format("'{0}' usage (with generic argument '{1}')", descriptor.Title, string.Join(", ", genericTypeNames));
}
}
- return context.Create(IssueCategory.Code, descriptor.id)
+ return context.Create(IssueCategory.Code, descriptor.Id)
.WithDescription(description);
}
}
diff --git a/Editor/InstructionAnalyzers/DebugLogAnalyzer.cs b/Editor/InstructionAnalyzers/DebugLogAnalyzer.cs
index 7efa57a1a4..628cd33ad2 100644
--- a/Editor/InstructionAnalyzers/DebugLogAnalyzer.cs
+++ b/Editor/InstructionAnalyzers/DebugLogAnalyzer.cs
@@ -29,9 +29,9 @@ class DebugLogAnalyzer : ICodeModuleInstructionAnalyzer
"Remove logging code, or strip it from release builds by using scripting symbols for conditional compilation (#if ... #endif) or the ConditionalAttribute on a custom logging method that calls Debug.Log. Where logging is required in release builds, CPU times can be reduced by disabling stack traces in log messages. You can do this by setting Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None)."
)
{
- documentationUrl = "https://docs.unity3d.com/Manual/BestPracticeUnderstandingPerformanceInUnity7.html",
- messageFormat = "Use of Debug.{0} in '{1}'",
- defaultSeverity = Severity.Minor
+ DocumentationUrl = "https://docs.unity3d.com/Manual/BestPracticeUnderstandingPerformanceInUnity7.html",
+ MessageFormat = "Use of Debug.{0} in '{1}'",
+ DefaultSeverity = Severity.Minor
};
static readonly Descriptor k_DebugLogWarningIssueDescriptor = new Descriptor
@@ -43,9 +43,9 @@ class DebugLogAnalyzer : ICodeModuleInstructionAnalyzer
"Remove logging code, or strip it from release builds by using scripting symbols for conditional compilation (#if ... #endif) or the ConditionalAttribute on a custom logging method that calls Debug.LogWarning. Where logging is required in release builds, CPU times can be reduced by disabling stack traces in log messages. You can do this by setting Application.SetStackTraceLogType(LogType.Log, StackTraceLogType.None)."
)
{
- documentationUrl = "https://docs.unity3d.com/Manual/BestPracticeUnderstandingPerformanceInUnity7.html",
- messageFormat = "Use of Debug.{0} in '{1}'",
- defaultSeverity = Severity.Minor
+ DocumentationUrl = "https://docs.unity3d.com/Manual/BestPracticeUnderstandingPerformanceInUnity7.html",
+ MessageFormat = "Use of Debug.{0} in '{1}'",
+ DefaultSeverity = Severity.Minor
};
readonly OpCode[] m_OpCodes =
@@ -100,10 +100,10 @@ public IssueBuilder Analyze(InstructionAnalysisContext context)
{
case "Log":
case "LogFormat":
- return context.Create(IssueCategory.Code, k_DebugLogIssueDescriptor.id, methodName, context.MethodDefinition.Name);
+ return context.Create(IssueCategory.Code, k_DebugLogIssueDescriptor.Id, methodName, context.MethodDefinition.Name);
case "LogWarning":
case "LogWarningFormat":
- return context.Create(IssueCategory.Code, k_DebugLogWarningIssueDescriptor.id, methodName, context.MethodDefinition.Name);
+ return context.Create(IssueCategory.Code, k_DebugLogWarningIssueDescriptor.Id, methodName, context.MethodDefinition.Name);
default:
return null;
}
diff --git a/Editor/InstructionAnalyzers/EmptyMethodAnalyzer.cs b/Editor/InstructionAnalyzers/EmptyMethodAnalyzer.cs
index fb5506547d..ef72c2dec6 100644
--- a/Editor/InstructionAnalyzers/EmptyMethodAnalyzer.cs
+++ b/Editor/InstructionAnalyzers/EmptyMethodAnalyzer.cs
@@ -23,7 +23,7 @@ class EmptyMethodAnalyzer : ICodeModuleInstructionAnalyzer
"Remove any empty MonoBehaviour methods."
)
{
- messageFormat = "MonoBehaviour method '{0}' is empty"
+ MessageFormat = "MonoBehaviour method '{0}' is empty"
};
readonly OpCode[] m_OpCodes =
@@ -55,12 +55,12 @@ public IssueBuilder Analyze(InstructionAnalysisContext context)
if (!MonoBehaviourAnalysis.IsMonoBehaviourEvent(context.MethodDefinition))
return null;
- return context.Create(IssueCategory.Code, k_Descriptor.id, context.MethodDefinition.Name);
+ return context.Create(IssueCategory.Code, k_Descriptor.Id, context.MethodDefinition.Name);
}
internal static string GetDescriptorID()
{
- return k_Descriptor.id;
+ return k_Descriptor.Id;
}
}
}
diff --git a/Editor/InstructionAnalyzers/UnsupportedOnWebGLAnalyzer.cs b/Editor/InstructionAnalyzers/UnsupportedOnWebGLAnalyzer.cs
index 217c505d94..3f18fcec33 100644
--- a/Editor/InstructionAnalyzers/UnsupportedOnWebGLAnalyzer.cs
+++ b/Editor/InstructionAnalyzers/UnsupportedOnWebGLAnalyzer.cs
@@ -22,8 +22,8 @@ internal class UnsupportedOnWebGLAnalyzer : ICodeModuleInstructionAnalyzer
"Do not use the System.Net API on this platform."
)
{
- messageFormat = "'{0}' usage",
- platforms = new[] { "WebGL" }
+ MessageFormat = "'{0}' usage",
+ Platforms = new[] { "WebGL" }
};
internal static readonly Descriptor k_DescriptorSystemThreading = new Descriptor
@@ -35,8 +35,8 @@ internal class UnsupportedOnWebGLAnalyzer : ICodeModuleInstructionAnalyzer
"Do not use the System.Threading API on this platform."
)
{
- messageFormat = "'{0}' usage",
- platforms = new[] { "WebGL" }
+ MessageFormat = "'{0}' usage",
+ Platforms = new[] { "WebGL" }
};
internal static readonly Descriptor k_DescriptorMicrophone = new Descriptor
@@ -48,8 +48,8 @@ internal class UnsupportedOnWebGLAnalyzer : ICodeModuleInstructionAnalyzer
"Do not use the Microphone API on this platform."
)
{
- messageFormat = "'{0}' usage",
- platforms = new[] { "WebGL" }
+ MessageFormat = "'{0}' usage",
+ Platforms = new[] { "WebGL" }
};
readonly OpCode[] m_OpCodes =
@@ -70,9 +70,9 @@ public void Initialize(Module module)
module.RegisterDescriptor(k_DescriptorSystemThreading);
module.RegisterDescriptor(k_DescriptorMicrophone);
- descriptorSystemNetSupported = module.SupportsDescriptor(k_DescriptorSystemNet.id);
- descriptorSystemThreadingSupported = module.SupportsDescriptor(k_DescriptorSystemThreading.id);
- descriptorMicrophoneSupported = module.SupportsDescriptor(k_DescriptorMicrophone.id);
+ descriptorSystemNetSupported = module.SupportsDescriptor(k_DescriptorSystemNet.Id);
+ descriptorSystemThreadingSupported = module.SupportsDescriptor(k_DescriptorSystemThreading.Id);
+ descriptorMicrophoneSupported = module.SupportsDescriptor(k_DescriptorMicrophone.Id);
}
public IssueBuilder Analyze(InstructionAnalysisContext context)
@@ -80,15 +80,15 @@ public IssueBuilder Analyze(InstructionAnalysisContext context)
var methodReference = (MethodReference)context.Instruction.Operand;
if (descriptorSystemNetSupported && methodReference.DeclaringType.FullName.StartsWith("System.Net."))
{
- return context.Create(IssueCategory.Code, k_DescriptorSystemNet.id, methodReference.FullName);
+ return context.Create(IssueCategory.Code, k_DescriptorSystemNet.Id, methodReference.FullName);
}
if (descriptorSystemThreadingSupported && methodReference.DeclaringType.FullName.StartsWith("System.Threading."))
{
- return context.Create(IssueCategory.Code, k_DescriptorSystemThreading.id, methodReference.FullName);
+ return context.Create(IssueCategory.Code, k_DescriptorSystemThreading.Id, methodReference.FullName);
}
if (descriptorMicrophoneSupported && methodReference.DeclaringType.FullName.Equals("UnityEngine.Microphone"))
{
- return context.Create(IssueCategory.Code, k_DescriptorMicrophone.id, methodReference.FullName);
+ return context.Create(IssueCategory.Code, k_DescriptorMicrophone.Id, methodReference.FullName);
}
return null;
diff --git a/Editor/Modules/AssetsModule.cs b/Editor/Modules/AssetsModule.cs
index f64de69b54..d2bedffcb0 100644
--- a/Editor/Modules/AssetsModule.cs
+++ b/Editor/Modules/AssetsModule.cs
@@ -36,7 +36,7 @@ internal class AssetsModule : Module
"Use AssetBundles or Addressables when possible."
)
{
- messageFormat = "'{0}' {1}"
+ MessageFormat = "'{0}' {1}"
};
static readonly Descriptor k_StreamingAssetsFolderDescriptor = new Descriptor(
@@ -47,8 +47,8 @@ internal class AssetsModule : Module
$"Try to move files outside this folder and use Asset Bundles or Addressables when possible."
)
{
- platforms = new[] {"Android", "iOS"},
- messageFormat = "StreamingAssets folder contains {0} of data",
+ Platforms = new[] {"Android", "iOS"},
+ MessageFormat = "StreamingAssets folder contains {0} of data",
};
public override bool IsEnabledByDefault => false;
@@ -135,7 +135,7 @@ static void AnalyzeStreamingAssets(AnalysisContext context, IList
if (totalBytes > folderSizeLimitMB * 1024 * 1024)
{
issues.Add(
- context.Create(IssueCategory.AssetDiagnostic, k_StreamingAssetsFolderDescriptor.id,
+ context.Create(IssueCategory.AssetDiagnostic, k_StreamingAssetsFolderDescriptor.Id,
Formatting.FormatSize((ulong)totalBytes))
);
}
@@ -170,7 +170,7 @@ static DependencyNode AddResourceAsset(AnalysisContext context,
issues.Add(context.Create
(
IssueCategory.AssetDiagnostic,
- k_AssetInResourcesFolderDescriptor.id,
+ k_AssetInResourcesFolderDescriptor.Id,
Path.GetFileName(assetPath), isInResources ? "is in a Resources folder" : "is a dependency of a Resources folder asset"
)
.WithDependencies(dependencyNode)
diff --git a/Editor/Modules/AudioClipAnalyzer.cs b/Editor/Modules/AudioClipAnalyzer.cs
index 9a3cbfe198..31bf89a06b 100644
--- a/Editor/Modules/AudioClipAnalyzer.cs
+++ b/Editor/Modules/AudioClipAnalyzer.cs
@@ -42,7 +42,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Consider setting Load Type to Streaming in the AudioClip Import Settings."
)
{
- messageFormat = "AudioClip '{0}' Load Type is not set to Streaming",
+ MessageFormat = "AudioClip '{0}' Load Type is not set to Streaming",
fixer = (issue) =>
{
var audioImporter = AssetImporter.GetAtPath(issue.RelativePath) as AudioImporter;
@@ -64,7 +64,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Set Load Type to Compressed in Memory or Decompress On Load in the AudioClip Import Settings."
)
{
- messageFormat = "AudioClip '{0}' Load Type is set to Streaming",
+ MessageFormat = "AudioClip '{0}' Load Type is set to Streaming",
};
internal static readonly Descriptor k_AudioStereoClipsOnMobileDescriptor = new Descriptor(
@@ -75,7 +75,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Tick the Force To Mono checkbox in the AudioClip Import Settings."
)
{
- messageFormat = "AudioClip '{0}' is stereo",
+ MessageFormat = "AudioClip '{0}' is stereo",
fixer = (issue) =>
{
var audioImporter = AssetImporter.GetAtPath(issue.RelativePath) as AudioImporter;
@@ -85,7 +85,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
audioImporter.SaveAndReimport();
}
},
- platforms = new[] {"Android", "iOS"}
+ Platforms = new[] {"Android", "iOS"}
};
internal static readonly Descriptor k_AudioStereoClipWhichIsNotStreamingDescriptor = new Descriptor(
@@ -96,7 +96,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Tick the Force To Mono checkbox in the AudioClip Import Settings."
)
{
- messageFormat = "AudioClip '{0}' is stereo",
+ MessageFormat = "AudioClip '{0}' is stereo",
fixer = (issue) =>
{
var audioImporter = AssetImporter.GetAtPath(issue.RelativePath) as AudioImporter;
@@ -116,7 +116,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Consider setting the Load Type to Compressed In Memory or Streaming. If you have concerns about the CPU cost of decompressing Compressed In Memory clips for playback, consider a format which is fast to decompress, such as ADPCM."
)
{
- messageFormat = "AudioClip '{0}' is set to Decompress On Load",
+ MessageFormat = "AudioClip '{0}' is set to Decompress On Load",
};
internal static readonly Descriptor k_AudioCompressedInMemoryDescriptor = new Descriptor(
@@ -127,7 +127,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"If runtime performance is impacted, either set the Load Type to Decompress On Load or set the Compression Format to ADPCM, which is fast to decompress."
)
{
- messageFormat = "AudioClip '{0}' is Compressed In Memory",
+ MessageFormat = "AudioClip '{0}' is Compressed In Memory",
};
// Large compressed samples on mobile: Decrease quality or downsample
@@ -139,8 +139,8 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Reduce the Quality slider as far as possible without introducing audible artefacts. Alternatively, try setting the Sample Rate Setting to Override and the Sample Rate to a suitable value. 22050 Hz or is fine for most sounds, and 44100 Hz (CD Quality) can be useful for prominent sounds or music if they include high frequencies."
)
{
- messageFormat = "AudioClip '{0}' Compressed clip could be optimized for mobile",
- platforms = new[] {"Android", "iOS"}
+ MessageFormat = "AudioClip '{0}' Compressed clip could be optimized for mobile",
+ Platforms = new[] {"Android", "iOS"}
};
internal static readonly Descriptor k_Audio48KHzDescriptor = new Descriptor(
@@ -151,7 +151,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Set the Sample Rate Setting to Override and the Sample Rate to 48000 Hz or lower."
)
{
- messageFormat = "AudioClip '{0}' Sample Rate is over 48KHz",
+ MessageFormat = "AudioClip '{0}' Sample Rate is over 48KHz",
fixer = (issue) =>
{
var audioImporter = AssetImporter.GetAtPath(issue.RelativePath) as AudioImporter;
@@ -174,7 +174,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Consider un-ticking the Preload Audio Data checkbox. Audio preloading is only required when the AudioClip must play at the exact moment the scene begins simulating, or if the audio timing must be very precise the first time it is played."
)
{
- messageFormat = "AudioClip '{0}' is set to Preload Audio Data",
+ MessageFormat = "AudioClip '{0}' is set to Preload Audio Data",
fixer = (issue) =>
{
var audioImporter = AssetImporter.GetAtPath(issue.RelativePath) as AudioImporter;
@@ -200,7 +200,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Tick the Load In Background checkbox in the AudioClip Import Settings."
)
{
- messageFormat = "AudioClip '{0}' Load In Background is not enabled",
+ MessageFormat = "AudioClip '{0}' Load In Background is not enabled",
fixer = (issue) =>
{
var audioImporter = AssetImporter.GetAtPath(issue.RelativePath) as AudioImporter;
@@ -220,7 +220,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Set the Compression Format to Vorbis in the AudioClip's Import Settings."
)
{
- messageFormat = "AudioClip '{0}' Compression Format is MP3",
+ MessageFormat = "AudioClip '{0}' Compression Format is MP3",
fixer = (issue) =>
{
var audioImporter = AssetImporter.GetAtPath(issue.RelativePath) as AudioImporter;
@@ -243,7 +243,7 @@ class AudioClipAnalyzer : IAudioClipModuleAnalyzer
"Wherever possible, select a lossless file format such as .WAV or .AIFF for source assets."
)
{
- messageFormat = "AudioClip '{0}' source asset is in a lossy compressed format",
+ MessageFormat = "AudioClip '{0}' source asset is in a lossy compressed format",
};
public void Initialize(Module module)
@@ -355,14 +355,14 @@ public IEnumerable Analyze(AudioClipAnalysisContext context)
if (runtimeSize > context.StreamingClipThresholdBytes && !isStreaming)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioLongClipDoesNotStreamDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioLongClipDoesNotStreamDescriptor.Id, clipName)
.WithLocation(assetPath);
}
if (decompressedClipSize < context.StreamingClipThresholdBytes && isStreaming)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioShortClipStreamsDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioShortClipStreamsDescriptor.Id, clipName)
.WithLocation(assetPath);
}
@@ -371,13 +371,13 @@ public IEnumerable Analyze(AudioClipAnalysisContext context)
if (isMobileTarget)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioStereoClipsOnMobileDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioStereoClipsOnMobileDescriptor.Id, clipName)
.WithLocation(assetPath);
}
else if (!isStreaming)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioStereoClipWhichIsNotStreamingDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioStereoClipWhichIsNotStreamingDescriptor.Id, clipName)
.WithLocation(assetPath);
}
}
@@ -386,7 +386,7 @@ public IEnumerable Analyze(AudioClipAnalysisContext context)
sampleSettings.loadType == AudioClipLoadType.DecompressOnLoad)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioLongDecompressedClipDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioLongDecompressedClipDescriptor.Id, clipName)
.WithLocation(assetPath);
}
@@ -395,7 +395,7 @@ public IEnumerable Analyze(AudioClipAnalysisContext context)
sampleSettings.compressionFormat != AudioCompressionFormat.ADPCM)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioCompressedInMemoryDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioCompressedInMemoryDescriptor.Id, clipName)
.WithLocation(assetPath);
}
@@ -407,7 +407,7 @@ public IEnumerable Analyze(AudioClipAnalysisContext context)
sampleSettings.quality == 1.0f)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioLargeCompressedMobileDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioLargeCompressedMobileDescriptor.Id, clipName)
.WithLocation(assetPath);
}
@@ -417,28 +417,28 @@ public IEnumerable Analyze(AudioClipAnalysisContext context)
if (audioClip.frequency > 48000)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_Audio48KHzDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_Audio48KHzDescriptor.Id, clipName)
.WithLocation(assetPath);
}
if (preloadAudioData)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioPreloadDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioPreloadDescriptor.Id, clipName)
.WithLocation(assetPath);
}
if (!context.Importer.loadInBackground && compSize > context.LoadInBackGroundClipSizeThresholdBytes)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioLoadInBackgroundDisabledDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioLoadInBackgroundDisabledDescriptor.Id, clipName)
.WithLocation(assetPath);
}
if (sampleSettings.compressionFormat == AudioCompressionFormat.MP3)
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioMP3Descriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioMP3Descriptor.Id, clipName)
.WithLocation(assetPath);
}
@@ -447,7 +447,7 @@ public IEnumerable Analyze(AudioClipAnalysisContext context)
sourceFileExtension != "AIF")
{
yield return context.Create(
- IssueCategory.AssetDiagnostic, k_AudioCompressedSourceAssetDescriptor.id, clipName)
+ IssueCategory.AssetDiagnostic, k_AudioCompressedSourceAssetDescriptor.Id, clipName)
.WithLocation(assetPath);
}
}
diff --git a/Editor/Modules/CodeModule.cs b/Editor/Modules/CodeModule.cs
index 5179eb37ec..00d35dd7fa 100644
--- a/Editor/Modules/CodeModule.cs
+++ b/Editor/Modules/CodeModule.cs
@@ -488,9 +488,9 @@ IEnumerable ProcessCompilerMessages(AnalysisContext context, Assem
RoslynTextLookup.GetDescription(message.code),
RoslynTextLookup.GetRecommendation(message.code));
- DescriptorLibrary.RegisterDescriptor(descriptor.id, descriptor);
+ DescriptorLibrary.RegisterDescriptor(descriptor.Id, descriptor);
- yield return context.Create(IssueCategory.DomainReload, descriptor.id)
+ yield return context.Create(IssueCategory.DomainReload, descriptor.Id)
.WithLocation(relativePath, message.line)
.WithLogLevel(CompilerMessageTypeToLogLevel(message.type))
.WithCustomProperties(new object[(int)CompilerMessageProperty.Num]
diff --git a/Editor/Modules/MeshAnalyzer.cs b/Editor/Modules/MeshAnalyzer.cs
index bb938b479b..86c46182b2 100644
--- a/Editor/Modules/MeshAnalyzer.cs
+++ b/Editor/Modules/MeshAnalyzer.cs
@@ -23,8 +23,8 @@ class MeshAnalyzer : IMeshModuleAnalyzer
"If not required, disable the Read/Write Enabled option in the Model Import Settings."
)
{
- messageFormat = "Mesh '{0}' Read/Write is enabled",
- documentationUrl = "https://docs.unity3d.com/Manual/FBXImporter-Model.html"
+ MessageFormat = "Mesh '{0}' Read/Write is enabled",
+ DocumentationUrl = "https://docs.unity3d.com/Manual/FBXImporter-Model.html"
};
internal static readonly Descriptor k_Mesh32BitIndexFormatUsedDescriptor = new Descriptor(
@@ -35,8 +35,8 @@ class MeshAnalyzer : IMeshModuleAnalyzer
"Consider using changing the Index Format option in the Model Import Settings. This should be set to either 16 bits or Auto."
)
{
- messageFormat = "Mesh '{0}' Index Format is 32 bits",
- documentationUrl = "https://docs.unity3d.com/Manual/FBXImporter-Model.html"
+ MessageFormat = "Mesh '{0}' Index Format is 32 bits",
+ DocumentationUrl = "https://docs.unity3d.com/Manual/FBXImporter-Model.html"
};
public void Initialize(Module module)
@@ -79,7 +79,7 @@ public IEnumerable Analyze(MeshAnalysisContext context)
if (mesh.isReadable)
{
- yield return context.Create(IssueCategory.AssetDiagnostic, k_MeshReadWriteEnabledDescriptor.id, meshName)
+ yield return context.Create(IssueCategory.AssetDiagnostic, k_MeshReadWriteEnabledDescriptor.Id, meshName)
.WithLocation(assetPath);
}
@@ -87,7 +87,7 @@ public IEnumerable Analyze(MeshAnalysisContext context)
mesh.vertexCount <= 65535)
{
yield return context.Create(IssueCategory.AssetDiagnostic,
- k_Mesh32BitIndexFormatUsedDescriptor.id, meshName)
+ k_Mesh32BitIndexFormatUsedDescriptor.Id, meshName)
.WithLocation(assetPath);
}
}
diff --git a/Editor/Modules/PackagesModule.cs b/Editor/Modules/PackagesModule.cs
index 5a9434b970..d23026539f 100644
--- a/Editor/Modules/PackagesModule.cs
+++ b/Editor/Modules/PackagesModule.cs
@@ -56,8 +56,8 @@ class PackagesModule : Module
"Update the package via Package Manager."
)
{
- messageFormat = "'{0}' could be updated from version '{1}' to '{2}'",
- defaultSeverity = Severity.Minor
+ MessageFormat = "'{0}' could be updated from version '{1}' to '{2}'",
+ DefaultSeverity = Severity.Minor
};
static readonly Descriptor k_RecommendPackagePreView = new Descriptor(
@@ -68,7 +68,7 @@ class PackagesModule : Module
"Experimental packages should only be used for testing purposes and to give feedback to Unity."
)
{
- messageFormat = "'{0}' version '{1}' is a preview/experimental version"
+ MessageFormat = "'{0}' version '{1}' is a preview/experimental version"
};
public override string Name => "Packages";
@@ -134,13 +134,13 @@ IEnumerable EnumeratePackageDiagnostics(AnalysisContext context, U
{
if (!recommendedVersionString.Equals(package.version))
{
- yield return context.Create(IssueCategory.PackageDiagnostic, k_RecommendPackageUpgrade.id, package.name, package.version, recommendedVersionString)
+ yield return context.Create(IssueCategory.PackageDiagnostic, k_RecommendPackageUpgrade.Id, package.name, package.version, recommendedVersionString)
.WithLocation(package.assetPath);
}
}
else if (package.version.Contains("pre") || package.version.Contains("exp"))
{
- yield return context.Create(IssueCategory.PackageDiagnostic, k_RecommendPackagePreView.id, package.name, package.version)
+ yield return context.Create(IssueCategory.PackageDiagnostic, k_RecommendPackagePreView.Id, package.name, package.version)
.WithLocation(package.assetPath);
}
}
diff --git a/Editor/Modules/ShaderAnalyzer.cs b/Editor/Modules/ShaderAnalyzer.cs
index d199a96cd1..cf1cba51af 100644
--- a/Editor/Modules/ShaderAnalyzer.cs
+++ b/Editor/Modules/ShaderAnalyzer.cs
@@ -20,8 +20,8 @@ class ShaderAnalyzer : IShaderModuleAnalyzer
"Consider adding SRP Batcher compatibility to the shader. This will reduce the CPU time Unity requires to prepare and dispatch draw calls for materials that use the same shader variant."
)
{
- messageFormat = "Shader '{0}' is not compatible with SRP Batcher",
- documentationUrl = "https://docs.unity3d.com/Manual/SRPBatcher.html"
+ MessageFormat = "Shader '{0}' is not compatible with SRP Batcher",
+ DocumentationUrl = "https://docs.unity3d.com/Manual/SRPBatcher.html"
};
public void Initialize(Module module)
@@ -42,7 +42,7 @@ public IEnumerable Analyze(ShaderAnalysisContext context)
if (!isSrpBatchingCompatible && IsSrpBatchingEnabled)
{
- yield return context.Create(IssueCategory.AssetDiagnostic, k_SrpBatcherDescriptor.id, context.Shader.name)
+ yield return context.Create(IssueCategory.AssetDiagnostic, k_SrpBatcherDescriptor.Id, context.Shader.name)
.WithLocation(context.AssetPath);
}
#endif
diff --git a/Editor/Modules/SpriteAtlasAnalyzer.cs b/Editor/Modules/SpriteAtlasAnalyzer.cs
index 4bc1a1693a..277dc21d81 100644
--- a/Editor/Modules/SpriteAtlasAnalyzer.cs
+++ b/Editor/Modules/SpriteAtlasAnalyzer.cs
@@ -21,7 +21,7 @@ internal class SpriteAtlasAnalyzer : ISpriteAtlasModuleAnalyzer
"Consider reorganizing your Sprite Atlas Texture in order to reduce the amount of empty space."
)
{
- messageFormat = "Sprite Atlas '{0}' has too much empty space ({1})"
+ MessageFormat = "Sprite Atlas '{0}' has too much empty space ({1})"
};
public void Initialize(Module module)
@@ -40,7 +40,7 @@ public IEnumerable Analyze(SpriteAtlasAnalysisContext context)
if (emptyPercent > context.SpriteAtlasEmptySpaceLimit)
{
yield return context.Create(IssueCategory.AssetDiagnostic,
- k_SpriteAtlasEmptyDescriptor.id, spriteAtlas.name, Formatting.FormatPercentage(emptyPercent / 100.0f, 0))
+ k_SpriteAtlasEmptyDescriptor.Id, spriteAtlas.name, Formatting.FormatPercentage(emptyPercent / 100.0f, 0))
.WithLocation(context.AssetPath);
}
}
diff --git a/Editor/Modules/TextureAnalyzer.cs b/Editor/Modules/TextureAnalyzer.cs
index 359e8794b0..453f1187c0 100644
--- a/Editor/Modules/TextureAnalyzer.cs
+++ b/Editor/Modules/TextureAnalyzer.cs
@@ -26,7 +26,7 @@ class TextureAnalyzer : ITextureModuleAnalyzer
"Consider enabling mipmaps using the Advanced > Generate Mip Maps option in the Texture Import Settings."
)
{
- messageFormat = "Texture '{0}' mipmaps generation is not enabled",
+ MessageFormat = "Texture '{0}' mipmaps generation is not enabled",
fixer = (issue) =>
{
var textureImporter = AssetImporter.GetAtPath(issue.RelativePath) as TextureImporter;
@@ -46,7 +46,7 @@ class TextureAnalyzer : ITextureModuleAnalyzer
"Consider disabling mipmaps using the Advanced > Generate Mip Maps option in the texture inspector. This will also reduce your build size."
)
{
- messageFormat = "Texture '{0}' mipmaps generation is enabled",
+ MessageFormat = "Texture '{0}' mipmaps generation is enabled",
fixer = (issue) =>
{
var textureImporter = AssetImporter.GetAtPath(issue.RelativePath) as TextureImporter;
@@ -66,8 +66,8 @@ class TextureAnalyzer : ITextureModuleAnalyzer
"If not required, disable the Read/Write Enabled option in the Texture Import Settings."
)
{
- messageFormat = "Texture '{0}' Read/Write is enabled",
- documentationUrl = "https://docs.unity3d.com/Manual/class-TextureImporter.html",
+ MessageFormat = "Texture '{0}' Read/Write is enabled",
+ DocumentationUrl = "https://docs.unity3d.com/Manual/class-TextureImporter.html",
fixer = (issue) =>
{
var textureImporter = AssetImporter.GetAtPath(issue.RelativePath) as TextureImporter;
@@ -87,7 +87,7 @@ class TextureAnalyzer : ITextureModuleAnalyzer
"Consider enabling the Streaming Mipmaps option in the Texture Import Settings."
)
{
- messageFormat = "Texture '{0}' mipmaps streaming is not enabled",
+ MessageFormat = "Texture '{0}' mipmaps streaming is not enabled",
fixer = (issue) =>
{
var textureImporter = AssetImporter.GetAtPath(issue.RelativePath) as TextureImporter;
@@ -107,8 +107,8 @@ class TextureAnalyzer : ITextureModuleAnalyzer
"Consider setting the Anisotropic Level to 1."
)
{
- platforms = new[] {"Android", "iOS", "Switch"},
- messageFormat = "Texture '{0}' anisotropic level is set to '{1}'",
+ Platforms = new[] {"Android", "iOS", "Switch"},
+ MessageFormat = "Texture '{0}' anisotropic level is set to '{1}'",
fixer = (issue) =>
{
var textureImporter = AssetImporter.GetAtPath(issue.RelativePath) as TextureImporter;
@@ -167,7 +167,7 @@ public IEnumerable Analyze(TextureAnalysisContext context)
if (!context.Importer.mipmapEnabled && context.Importer.textureType == TextureImporterType.Default)
{
yield return context.Create(IssueCategory.AssetDiagnostic,
- k_TextureMipMapNotEnabledDescriptor.id, context.Name)
+ k_TextureMipMapNotEnabledDescriptor.Id, context.Name)
.WithLocation(assetPath);
}
@@ -176,26 +176,26 @@ public IEnumerable Analyze(TextureAnalysisContext context)
)
{
yield return context.Create(IssueCategory.AssetDiagnostic,
- k_TextureMipMapEnabledDescriptor.id, context.Name)
+ k_TextureMipMapEnabledDescriptor.Id, context.Name)
.WithLocation(assetPath);
}
if (context.Importer.isReadable)
{
- yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureReadWriteEnabledDescriptor.id, context.Name)
+ yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureReadWriteEnabledDescriptor.Id, context.Name)
.WithLocation(context.Importer.assetPath);
}
if (context.Importer.mipmapEnabled && !context.Importer.streamingMipmaps && size > Mathf.Pow(context.TextureStreamingMipmapsSizeLimit, 2))
{
- yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureStreamingMipMapEnabledDescriptor.id, context.Name)
+ yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureStreamingMipMapEnabledDescriptor.Id, context.Name)
.WithLocation(context.Importer.assetPath);
}
if (k_TextureAnisotropicLevelDescriptor.IsApplicable(context.Params) &&
context.Importer.mipmapEnabled && context.Importer.filterMode != FilterMode.Point && context.Importer.anisoLevel > 1)
{
- yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureAnisotropicLevelDescriptor.id, context.Name, context.Importer.anisoLevel)
+ yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureAnisotropicLevelDescriptor.Id, context.Name, context.Importer.anisoLevel)
.WithLocation(context.Importer.assetPath);
}
}
diff --git a/Editor/Modules/TextureUtilizationAnalyzer.cs b/Editor/Modules/TextureUtilizationAnalyzer.cs
index 3913acf71f..2d411f71e1 100644
--- a/Editor/Modules/TextureUtilizationAnalyzer.cs
+++ b/Editor/Modules/TextureUtilizationAnalyzer.cs
@@ -23,8 +23,8 @@ class TextureUtilizationAnalyzer : ITextureModuleAnalyzer
"Consider shrinking the texture to 1x1 size."
)
{
- isEnabledByDefault = false,
- messageFormat = "Texture '{0}' is a solid color and not 1x1 size",
+ IsEnabledByDefault = false,
+ MessageFormat = "Texture '{0}' is a solid color and not 1x1 size",
fixer = (issue) => { ShrinkSolidTexture(issue.RelativePath); }
};
@@ -37,8 +37,8 @@ class TextureUtilizationAnalyzer : ITextureModuleAnalyzer
"Consider shrinking the texture to 1x1 size."
)
{
- isEnabledByDefault = false,
- messageFormat = "Texture '{0}' is a solid color and not 1x1 size"
+ IsEnabledByDefault = false,
+ MessageFormat = "Texture '{0}' is a solid color and not 1x1 size"
};
internal static readonly Descriptor k_TextureAtlasEmptyDescriptor = new Descriptor(
@@ -49,8 +49,8 @@ class TextureUtilizationAnalyzer : ITextureModuleAnalyzer
"Consider reorganizing your texture atlas in order to reduce the amount of empty space."
)
{
- isEnabledByDefault = false,
- messageFormat = "Texture Atlas '{0}' has too much empty space ({1})"
+ IsEnabledByDefault = false,
+ MessageFormat = "Texture Atlas '{0}' has too much empty space ({1})"
};
public void Initialize(Module module)
@@ -66,7 +66,7 @@ public IEnumerable Analyze(TextureAnalysisContext context)
if (context.IsDescriptorEnabled(dimensionAppropriateDescriptor) &&
TextureUtils.IsTextureSolidColorTooBig(context.Importer, context.Texture))
{
- yield return context.Create(IssueCategory.AssetDiagnostic, dimensionAppropriateDescriptor.id, context.Name)
+ yield return context.Create(IssueCategory.AssetDiagnostic, dimensionAppropriateDescriptor.Id, context.Name)
.WithLocation(context.Importer.assetPath);
}
@@ -76,7 +76,7 @@ public IEnumerable Analyze(TextureAnalysisContext context)
var emptyPercent = TextureUtils.GetEmptyPixelsPercent(texture2D);
if (emptyPercent > context.SpriteAtlasEmptySpaceLimit)
{
- yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureAtlasEmptyDescriptor.id, context.Name, Formatting.FormatPercentage(emptyPercent / 100.0f))
+ yield return context.Create(IssueCategory.AssetDiagnostic, k_TextureAtlasEmptyDescriptor.Id, context.Name, Formatting.FormatPercentage(emptyPercent / 100.0f))
.WithLocation(context.Importer.assetPath);
}
}
diff --git a/Editor/ProjectIssue.cs b/Editor/ProjectIssue.cs
index 8556a60b1a..c8241d61db 100644
--- a/Editor/ProjectIssue.cs
+++ b/Editor/ProjectIssue.cs
@@ -62,14 +62,14 @@ internal ProjectIssue(IssueCategory category, string id, params object[] args)
try
{
- m_Description = string.IsNullOrEmpty(descriptor.messageFormat) ? descriptor.title : string.Format(descriptor.messageFormat, args);
+ m_Description = string.IsNullOrEmpty(descriptor.MessageFormat) ? descriptor.Title : string.Format(descriptor.MessageFormat, args);
}
catch (Exception e)
{
- Debug.LogError("Error formatting message: " + descriptor.messageFormat + " with args: " + string.Join(", ", args) + " - " + e.Message);
- m_Description = descriptor.title;
+ Debug.LogError("Error formatting message: " + descriptor.MessageFormat + " with args: " + string.Join(", ", args) + " - " + e.Message);
+ m_Description = descriptor.Title;
}
- m_Severity = descriptor.defaultSeverity;
+ m_Severity = descriptor.DefaultSeverity;
}
///
@@ -200,7 +200,7 @@ public LogLevel LogLevel
[JsonIgnore]
public Severity Severity
{
- get => m_Severity == Severity.Default && m_DescriptorId.IsValid() ? m_DescriptorId.GetDescriptor().defaultSeverity : m_Severity;
+ get => m_Severity == Severity.Default && m_DescriptorId.IsValid() ? m_DescriptorId.GetDescriptor().DefaultSeverity : m_Severity;
set => m_Severity = value;
}
diff --git a/Editor/ProjectIssueExtensions.cs b/Editor/ProjectIssueExtensions.cs
index 04f9f5ec2b..133415ef5a 100644
--- a/Editor/ProjectIssueExtensions.cs
+++ b/Editor/ProjectIssueExtensions.cs
@@ -39,7 +39,7 @@ public static string GetProperty(this ProjectIssue issue, PropertyType propertyT
case PropertyType.Description:
return issue.Description;
case PropertyType.Descriptor:
- return issue.Id.GetDescriptor().title;
+ return issue.Id.GetDescriptor().Title;
case PropertyType.Filename:
if (string.IsNullOrEmpty(issue.Filename))
return k_NotAvailable;
@@ -95,8 +95,8 @@ internal static int CompareTo(this ProjectIssue issueA, ProjectIssue issueB, Pro
case PropertyType.Severity:
return issueA.Severity.CompareTo(issueB.Severity);
case PropertyType.Area:
- var areasA = issueA.Id.GetDescriptor().areas;
- var areasB = issueB.Id.GetDescriptor().areas;
+ var areasA = issueA.Id.GetDescriptor().Areas;
+ var areasB = issueB.Id.GetDescriptor().Areas;
var minLength = Math.Min(areasA.Length, areasB.Length);
diff --git a/Editor/ProjectReport.cs b/Editor/ProjectReport.cs
index 8da6bd0fd2..235993cd3c 100644
--- a/Editor/ProjectReport.cs
+++ b/Editor/ProjectReport.cs
@@ -264,6 +264,7 @@ public void Save(string path)
JsonConvert.SerializeObject(this, UserPreferences.PrettifyJsonOutput ? Formatting.Indented : Formatting.None,
new JsonSerializerSettings
{
+ Converters = new List { new DescriptorJsonConverter() },
NullValueHandling = NullValueHandling.Ignore
}));
}
diff --git a/Editor/SettingsAnalysis/BuiltinRenderPipelineAnalyzer.cs b/Editor/SettingsAnalysis/BuiltinRenderPipelineAnalyzer.cs
index 4cd71cb346..fea07ffaa7 100644
--- a/Editor/SettingsAnalysis/BuiltinRenderPipelineAnalyzer.cs
+++ b/Editor/SettingsAnalysis/BuiltinRenderPipelineAnalyzer.cs
@@ -54,17 +54,17 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (IsMixedStandardShaderQuality(context.Params.Platform))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_ShaderQualityDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_ShaderQualityDescriptor.Id)
.WithLocation("Project/Graphics");
}
if (IsUsingForwardRendering(context.Params.Platform))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_ForwardRenderingDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_ForwardRenderingDescriptor.Id)
.WithLocation("Project/Graphics");
}
if (IsUsingDeferredRendering(context.Params.Platform))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_DeferredRenderingDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DeferredRenderingDescriptor.Id)
.WithLocation("Project/Graphics");
}
}
diff --git a/Editor/SettingsAnalysis/BuiltinSettingsAnalyzer.cs b/Editor/SettingsAnalysis/BuiltinSettingsAnalyzer.cs
index 4d15456cc2..bbccad3f20 100644
--- a/Editor/SettingsAnalysis/BuiltinSettingsAnalyzer.cs
+++ b/Editor/SettingsAnalysis/BuiltinSettingsAnalyzer.cs
@@ -66,13 +66,13 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
ProjectIssue Evaluate(AnalysisContext context, Descriptor descriptor)
{
// evaluate a Unity API static method or property
- var assembly = m_Assemblies.First(a => a.GetType(descriptor.type) != null);
- var type = assembly.GetType(descriptor.type);
+ var assembly = m_Assemblies.First(a => a.GetType(descriptor.Type) != null);
+ var type = assembly.GetType(descriptor.Type);
- var methodName = descriptor.method;
- var property = type.GetProperty(descriptor.method);
+ var methodName = descriptor.Method;
+ var property = type.GetProperty(descriptor.Method);
if (property != null)
- methodName = "get_" + descriptor.method;
+ methodName = "get_" + descriptor.Method;
var paramTypes = new Type[] {};
var args = new object[] {};
@@ -80,14 +80,14 @@ ProjectIssue Evaluate(AnalysisContext context, Descriptor descriptor)
try
{
var value = MethodEvaluator.Eval(assembly.Location,
- descriptor.type, methodName, paramTypes, args);
+ descriptor.Type, methodName, paramTypes, args);
- if (value.ToString() == descriptor.value)
- return NewIssue(context, descriptor, descriptor.title);
+ if (value.ToString() == descriptor.Value)
+ return NewIssue(context, descriptor, descriptor.Title);
}
catch (ArgumentException e)
{
- Debug.LogWarning($"Could not evaluate {descriptor.type}.{methodName}. Exception: {e.Message}");
+ Debug.LogWarning($"Could not evaluate {descriptor.Type}.{methodName}. Exception: {e.Message}");
}
return null;
@@ -96,13 +96,13 @@ ProjectIssue Evaluate(AnalysisContext context, Descriptor descriptor)
ProjectIssue NewIssue(AnalysisContext context, Descriptor descriptor, string description)
{
var projectWindowPath = string.Empty;
- var mappings = m_ProjectSettingsMapping.Where(p => descriptor.type.StartsWith(p.Key)).ToArray();
+ var mappings = m_ProjectSettingsMapping.Where(p => descriptor.Type.StartsWith(p.Key)).ToArray();
if (mappings.Any())
projectWindowPath = mappings.First().Value;
return context.Create
(
IssueCategory.ProjectSetting,
- descriptor.id,
+ descriptor.Id,
description
).WithLocation(projectWindowPath);
}
diff --git a/Editor/SettingsAnalysis/EditorSettingsAnalyzer.cs b/Editor/SettingsAnalysis/EditorSettingsAnalyzer.cs
index 9251665579..e5de60dd1f 100644
--- a/Editor/SettingsAnalysis/EditorSettingsAnalyzer.cs
+++ b/Editor/SettingsAnalysis/EditorSettingsAnalyzer.cs
@@ -19,7 +19,7 @@ class EditorSettingsAnalyzer : ISettingsModuleAnalyzer
"In Editor Settings, enable the Enter Play Mode Settings > Enter Play Mode Options option, then disable the Reload Domain option. Be sure to view the Code/Domain Reload view in this tool for additional things you may need to fix as a result of disabling domain reload."
)
{
- maximumVersion = "2023.4",
+ MaximumVersion = "2023.4",
fixer = (issue) =>
{
EditorSettings.enterPlayModeOptionsEnabled = true;
@@ -34,7 +34,7 @@ class EditorSettingsAnalyzer : ISettingsModuleAnalyzer
"In Editor Settings, enable the Enter Play Mode Settings > Enter Play Mode Options option, then disable the Reload Domain checkbox. Be sure to view the Code/Domain Reload view in this tool for additional things you may need to fix as a result of disabling domain reload."
)
{
- maximumVersion = "2023.4",
+ MaximumVersion = "2023.4",
fixer = (issue) =>
{
EditorSettings.enterPlayModeOptions |= EnterPlayModeOptions.DisableDomainReload;
@@ -52,7 +52,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
if (k_EnterPlayModeOptionsDescriptor.IsVersionCompatible() &&
!EditorSettings.enterPlayModeOptionsEnabled)
{
- yield return context.Create(IssueCategory.ProjectSetting, k_EnterPlayModeOptionsDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_EnterPlayModeOptionsDescriptor.Id)
.WithLocation("Project/Editor");
}
else
@@ -60,7 +60,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
if (k_DomainReloadDescriptor.IsVersionCompatible() &&
(EditorSettings.enterPlayModeOptions & EnterPlayModeOptions.DisableDomainReload) != EnterPlayModeOptions.DisableDomainReload)
{
- yield return context.Create(IssueCategory.ProjectSetting, k_DomainReloadDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DomainReloadDescriptor.Id)
.WithLocation("Project/Editor");
}
}
diff --git a/Editor/SettingsAnalysis/FogStrippingAnalyzer.cs b/Editor/SettingsAnalysis/FogStrippingAnalyzer.cs
index 20fe37e7d0..fbe31f70b6 100644
--- a/Editor/SettingsAnalysis/FogStrippingAnalyzer.cs
+++ b/Editor/SettingsAnalysis/FogStrippingAnalyzer.cs
@@ -36,7 +36,7 @@ class FogStrippingAnalyzer : ISettingsModuleAnalyzer
RemoveFogStripping();
}),
- messageFormat = "Graphics: Fog Mode '{0}' shader variants are always included in the build"
+ MessageFormat = "Graphics: Fog Mode '{0}' shader variants are always included in the build"
};
public void Initialize(Module module)
@@ -48,19 +48,19 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (IsFogModeEnabled(FogMode.Linear))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_FogModeDescriptor.id, FogMode.Linear)
+ yield return context.Create(IssueCategory.ProjectSetting, k_FogModeDescriptor.Id, FogMode.Linear)
.WithLocation("Project/Graphics");
}
if (IsFogModeEnabled(FogMode.Exponential))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_FogModeDescriptor.id, FogMode.Exponential)
+ yield return context.Create(IssueCategory.ProjectSetting, k_FogModeDescriptor.Id, FogMode.Exponential)
.WithLocation("Project/Graphics");
}
if (IsFogModeEnabled(FogMode.ExponentialSquared))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_FogModeDescriptor.id, FogMode.ExponentialSquared)
+ yield return context.Create(IssueCategory.ProjectSetting, k_FogModeDescriptor.Id, FogMode.ExponentialSquared)
.WithLocation("Project/Graphics");
}
}
diff --git a/Editor/SettingsAnalysis/GraphicsApiAnalyzer.cs b/Editor/SettingsAnalysis/GraphicsApiAnalyzer.cs
index cb03a42353..13ed18fcad 100644
--- a/Editor/SettingsAnalysis/GraphicsApiAnalyzer.cs
+++ b/Editor/SettingsAnalysis/GraphicsApiAnalyzer.cs
@@ -26,8 +26,8 @@ class GraphicsApiAnalyzer : ISettingsModuleAnalyzer
"In the iOS Player Settings, both Metal and OpenGLES graphics APIs are enabled.",
"To reduce build size, remove OpenGLES graphics API if the minimum spec target device supports Metal.")
{
- documentationUrl = documentationUrl,
- platforms = new[] { BuildTarget.iOS.ToString() }
+ DocumentationUrl = documentationUrl,
+ Platforms = new[] { BuildTarget.iOS.ToString() }
};
static readonly Descriptor k_MetalDescriptor = new Descriptor(
@@ -37,8 +37,8 @@ class GraphicsApiAnalyzer : ISettingsModuleAnalyzer
"In the iOS Player Settings, Metal is not enabled.",
"Enable Metal graphics API for better CPU Performance.")
{
- documentationUrl = documentationUrl,
- platforms = new[] { BuildTarget.iOS.ToString() }
+ DocumentationUrl = documentationUrl,
+ Platforms = new[] { BuildTarget.iOS.ToString() }
};
static readonly Descriptor k_VulkanDescriptor = new Descriptor(
@@ -48,8 +48,8 @@ class GraphicsApiAnalyzer : ISettingsModuleAnalyzer
"In the Android Player Settings, Vulkan graphics API is not enabled.",
"Enable Vulkan graphics API for better CPU Performance.")
{
- documentationUrl = documentationUrl,
- platforms = new[] { BuildTarget.Android.ToString() }
+ DocumentationUrl = documentationUrl,
+ Platforms = new[] { BuildTarget.Android.ToString() }
};
public void Initialize(Module module)
@@ -64,18 +64,18 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
if (context.Params.Platform == BuildTarget.iOS)
{
if (IsUsingOpenGLESAndMetal())
- yield return context.Create(IssueCategory.ProjectSetting, k_OpenGLESAndMetalDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_OpenGLESAndMetalDescriptor.Id)
.WithLocation("Project/Player");
if (IsNotUsingMetal())
- yield return context.Create(IssueCategory.ProjectSetting, k_MetalDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_MetalDescriptor.Id)
.WithLocation("Project/Player");
}
if (context.Params.Platform == BuildTarget.Android)
{
if (IsNotUsingVulkan())
- yield return context.Create(IssueCategory.ProjectSetting, k_VulkanDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_VulkanDescriptor.Id)
.WithLocation("Project/Player");
}
}
diff --git a/Editor/SettingsAnalysis/HDRenderPipelineAnalyzer.cs b/Editor/SettingsAnalysis/HDRenderPipelineAnalyzer.cs
index ff7feb5656..95dae7818d 100644
--- a/Editor/SettingsAnalysis/HDRenderPipelineAnalyzer.cs
+++ b/Editor/SettingsAnalysis/HDRenderPipelineAnalyzer.cs
@@ -58,10 +58,10 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
if (deferredCamera && forwardCamera)
yield return context.Create(IssueCategory.ProjectSetting,
- k_CameraLitShaderModeBothOrMixed.id);
+ k_CameraLitShaderModeBothOrMixed.Id);
}
- yield return context.Create(IssueCategory.ProjectSetting, k_AssetLitShaderModeBothOrMixed.id);
+ yield return context.Create(IssueCategory.ProjectSetting, k_AssetLitShaderModeBothOrMixed.Id);
}
}
diff --git a/Editor/SettingsAnalysis/Physics2DAnalyzer.cs b/Editor/SettingsAnalysis/Physics2DAnalyzer.cs
index 40d629a986..01d1c3816c 100644
--- a/Editor/SettingsAnalysis/Physics2DAnalyzer.cs
+++ b/Editor/SettingsAnalysis/Physics2DAnalyzer.cs
@@ -31,7 +31,7 @@ class Physics2DAnalyzer : ISettingsModuleAnalyzer
"Simulation Mode in Physics2D Settings is set to either FixedUpdate or Update. As a result, 2D physics simulation is executed on every update which might be expensive for some projects.",
"Change Project Settings > Physics 2D > Simulation Mode to Script to disable the 2d physics processing each frame. If physics simulation is required for certain special rendering, use Script mode to control Physics2d.Simulate on a per frame basis.")
{
- minimumVersion = "2020.2"
+ MinimumVersion = "2020.2"
};
public void Initialize(Module module)
@@ -44,12 +44,12 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (IsDefaultLayerCollisionMatrix())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_DefaultLayerCollisionMatrixDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DefaultLayerCollisionMatrixDescriptor.Id)
.WithLocation("Project/Physics 2D");
}
if (k_SimulationModeDescriptor.IsApplicable(context.Params) && IsNotUsingSimulationModeScript())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_SimulationModeDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_SimulationModeDescriptor.Id)
.WithLocation("Project/Physics 2D");
}
}
diff --git a/Editor/SettingsAnalysis/PhysicsAnalyzer.cs b/Editor/SettingsAnalysis/PhysicsAnalyzer.cs
index 237024fe7e..9451b0f5f7 100644
--- a/Editor/SettingsAnalysis/PhysicsAnalyzer.cs
+++ b/Editor/SettingsAnalysis/PhysicsAnalyzer.cs
@@ -32,7 +32,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (IsDefaultLayerCollisionMatrix())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_DefaultLayerCollisionMatrixDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DefaultLayerCollisionMatrixDescriptor.Id)
.WithLocation("Project/Physics");
}
}
diff --git a/Editor/SettingsAnalysis/PlayerSettingsAnalyzer.cs b/Editor/SettingsAnalysis/PlayerSettingsAnalyzer.cs
index 12f2e8908d..66ddee8458 100644
--- a/Editor/SettingsAnalysis/PlayerSettingsAnalyzer.cs
+++ b/Editor/SettingsAnalysis/PlayerSettingsAnalyzer.cs
@@ -31,7 +31,7 @@ class PlayerSettingsAnalyzer : ISettingsModuleAnalyzer
"Accelerometer Frequency in iOS Player Settings is not set to Disabled. Polling the device's accelerometer incurs a small amount of CPU processing time.",
"Set Accelerometer Frequency to Disabled if your application doesn't make use of the device's accelerometer.")
{
- platforms = new[] { BuildTarget.iOS.ToString() }
+ Platforms = new[] { BuildTarget.iOS.ToString() }
};
static readonly Descriptor k_SplashScreenDescriptor = new Descriptor(
@@ -48,7 +48,7 @@ class PlayerSettingsAnalyzer : ISettingsModuleAnalyzer
"Default Speaker Mode in Audio Settings is not set to Mono. This may result in a build which is larger than necessary and which occupies more audio memory at runtime. Many mobile devices have limited or nonexistent stereo speaker options.",
"Change Project Settings > Audio > Default Speaker Mode to Mono. You should also consider enabling the Force To Mono AudioClip import setting to reduce import times and build size.")
{
- platforms = new[] { "Android", "iOS"},
+ Platforms = new[] { "Android", "iOS"},
fixer = (issue =>
{
FixSpeakerMode();
@@ -68,7 +68,7 @@ class PlayerSettingsAnalyzer : ISettingsModuleAnalyzer
SetIL2CPPConfigurationToRelease(buildTargetGroup);
}),
- messageFormat = "Player: C++ Compiler Configuration is set to 'Master'"
+ MessageFormat = "Player: C++ Compiler Configuration is set to 'Master'"
};
static readonly Descriptor k_IL2CPPCompilerConfigurationDebugDescriptor = new Descriptor(
@@ -84,7 +84,7 @@ class PlayerSettingsAnalyzer : ISettingsModuleAnalyzer
SetIL2CPPConfigurationToRelease(buildTargetGroup);
}),
- messageFormat = "Player: C++ Compiler Configuration is set to 'Debug'"
+ MessageFormat = "Player: C++ Compiler Configuration is set to 'Debug'"
};
static readonly Descriptor k_LightmapStreamingEnabledDescriptor = new Descriptor(
@@ -115,36 +115,36 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (k_AccelerometerDescriptor.IsApplicable(context.Params) && IsAccelerometerEnabled())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_AccelerometerDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_AccelerometerDescriptor.Id)
.WithLocation("Project/Player");
}
if (IsSplashScreenEnabledAndCanBeDisabled())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_SplashScreenDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_SplashScreenDescriptor.Id)
.WithLocation("Project/Player");
}
if (k_SpeakerModeDescriptor.IsApplicable(context.Params) && !IsSpeakerModeMono())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_SpeakerModeDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_SpeakerModeDescriptor.Id)
.WithLocation("Project/Player");
}
var buildTargetGroup = BuildPipeline.GetBuildTargetGroup(context.Params.Platform);
if (CheckIL2CPPCompilerConfiguration(Il2CppCompilerConfiguration.Master, context.Params))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_IL2CPPCompilerConfigurationMasterDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_IL2CPPCompilerConfigurationMasterDescriptor.Id)
.WithCustomProperties(new object[] {buildTargetGroup})
.WithLocation("Project/Player");
}
if (CheckIL2CPPCompilerConfiguration(Il2CppCompilerConfiguration.Debug, context.Params))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_IL2CPPCompilerConfigurationDebugDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_IL2CPPCompilerConfigurationDebugDescriptor.Id)
.WithCustomProperties(new object[] {buildTargetGroup})
.WithLocation("Project/Player");
}
if (!PlayerSettingsUtil.IsLightmapStreamingEnabled(buildTargetGroup))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_LightmapStreamingEnabledDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_LightmapStreamingEnabledDescriptor.Id)
.WithCustomProperties(new object[] {buildTargetGroup})
.WithLocation("Project/Player");
}
diff --git a/Editor/SettingsAnalysis/QualitySettingsAnalyzer.cs b/Editor/SettingsAnalysis/QualitySettingsAnalyzer.cs
index 94c250e405..d1b735eb69 100644
--- a/Editor/SettingsAnalysis/QualitySettingsAnalyzer.cs
+++ b/Editor/SettingsAnalysis/QualitySettingsAnalyzer.cs
@@ -58,8 +58,8 @@ class QualitySettingsAnalyzer : ISettingsModuleAnalyzer
EnableStreamingMipmap(issue.GetCustomPropertyInt32(0));
}),
- documentationUrl = "https://docs.unity3d.com/Manual/TextureStreaming.html",
- messageFormat = "Quality: Texture streaming on Quality Level '{0}' is turned off"
+ DocumentationUrl = "https://docs.unity3d.com/Manual/TextureStreaming.html",
+ MessageFormat = "Quality: Texture streaming on Quality Level '{0}' is turned off"
};
public void Initialize(Module module)
@@ -75,25 +75,25 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (IsUsingDefaultSettings())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_DefaultSettingsDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DefaultSettingsDescriptor.Id)
.WithLocation("Project/Quality");
}
if (IsUsingLowQualityTextures())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_UsingLowQualityTexturesDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_UsingLowQualityTexturesDescriptor.Id)
.WithLocation("Project/Quality");
}
if (IsDefaultAsyncUploadTimeSlice())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_DefaultAsyncUploadTimeSliceDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DefaultAsyncUploadTimeSliceDescriptor.Id)
.WithLocation("Project/Quality");
}
if (IsDefaultAsyncUploadBufferSize())
{
- yield return context.Create(IssueCategory.ProjectSetting, k_DefaultAsyncUploadBufferSizeSliceDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DefaultAsyncUploadBufferSizeSliceDescriptor.Id)
.WithLocation("Project/Quality");
}
@@ -103,7 +103,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
foreach (var levelIndex in qualityLevels)
{
var levelName = QualitySettings.names[levelIndex];
- yield return context.Create(IssueCategory.ProjectSetting, k_TextureStreamingDisabledDescriptor.id, levelName)
+ yield return context.Create(IssueCategory.ProjectSetting, k_TextureStreamingDisabledDescriptor.Id, levelName)
.WithCustomProperties(new object[] {levelIndex})
.WithLocation("Project/Quality/" + levelName);
}
diff --git a/Editor/SettingsAnalysis/SrpAssetSettingsAnalyzer.cs b/Editor/SettingsAnalysis/SrpAssetSettingsAnalyzer.cs
index a74e4a4c5c..c1a7baf4ee 100644
--- a/Editor/SettingsAnalysis/SrpAssetSettingsAnalyzer.cs
+++ b/Editor/SettingsAnalysis/SrpAssetSettingsAnalyzer.cs
@@ -25,7 +25,7 @@ class SrpAssetSettingsAnalyzer : ISettingsModuleAnalyzer
"SRP Batcher is disabled in a Render Pipeline Asset.",
"Enable SRP Batcher in Render Pipeline Asset. If the option is hidden, click the vertical ellipsis icon and select Show Additional Properties. Enabling the SRP Batcher will reduce the CPU time Unity requires to prepare and dispatch draw calls for materials that use the same shader variant.")
{
- messageFormat = "SRP batcher is disabled in {0}.asset in {1}",
+ MessageFormat = "SRP batcher is disabled in {0}.asset in {1}",
fixer = FixSrpBatcherSetting
};
@@ -62,7 +62,7 @@ IEnumerable Analyze(SettingsAnalysisContext context, RenderPipelin
static ProjectIssue CreateSrpBatcherIssue(AnalysisContext context, int qualityLevel, string name)
{
- return RenderPipelineUtils.CreateAssetSettingIssue(context, qualityLevel, name, k_SRPBatcherSettingDescriptor.id);
+ return RenderPipelineUtils.CreateAssetSettingIssue(context, qualityLevel, name, k_SRPBatcherSettingDescriptor.Id);
}
internal static bool? GetSrpBatcherSetting(RenderPipelineAsset renderPipeline)
diff --git a/Editor/SettingsAnalysis/StrippingAnalyzer.cs b/Editor/SettingsAnalysis/StrippingAnalyzer.cs
index 0fbb224552..96b89650f4 100644
--- a/Editor/SettingsAnalysis/StrippingAnalyzer.cs
+++ b/Editor/SettingsAnalysis/StrippingAnalyzer.cs
@@ -21,7 +21,7 @@ class StrippingAnalyzer : ISettingsModuleAnalyzer
"The Strip Engine Code is option in Player Settings is disabled. The generated build will be larger than necessary.",
"Enable Strip Engine Code in Project Settings > Player > Other Settings > Optimization.")
{
- platforms = new string[] { BuildTarget.Android.ToString(), BuildTarget.iOS.ToString(), BuildTarget.WebGL.ToString() }
+ Platforms = new string[] { BuildTarget.Android.ToString(), BuildTarget.iOS.ToString(), BuildTarget.WebGL.ToString() }
};
static readonly Descriptor k_AndroidManagedStrippingDescriptor = new Descriptor(
@@ -35,7 +35,7 @@ class StrippingAnalyzer : ISettingsModuleAnalyzer
#endif
"Set Managed Stripping Level in the Android Player Settings to Medium or High.")
{
- platforms = new string[] { BuildTarget.Android.ToString() }
+ Platforms = new string[] { BuildTarget.Android.ToString() }
};
static readonly Descriptor k_iOSManagedStrippingDescriptor = new Descriptor(
@@ -45,7 +45,7 @@ class StrippingAnalyzer : ISettingsModuleAnalyzer
"The Managed Stripping Level in the iOS Player Settings is set to Disabled, Low or Minimal. The generated build will be larger than necessary.",
"Set Managed Stripping Level in the iOS Player Settings to Medium or High.")
{
- platforms = new string[] { BuildTarget.iOS.ToString() }
+ Platforms = new string[] { BuildTarget.iOS.ToString() }
};
public void Initialize(Module module)
@@ -59,7 +59,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (k_EngineCodeStrippingDescriptor.IsApplicable(context.Params) && !PlayerSettings.stripEngineCode)
{
- yield return context.Create(IssueCategory.ProjectSetting, k_EngineCodeStrippingDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_EngineCodeStrippingDescriptor.Id)
.WithLocation("Project/Player");
}
@@ -71,7 +71,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
|| value == ManagedStrippingLevel.Minimal
#endif
)
- yield return context.Create(IssueCategory.ProjectSetting, k_AndroidManagedStrippingDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_AndroidManagedStrippingDescriptor.Id)
.WithLocation("Project/Player");
}
@@ -79,7 +79,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
var value = PlayerSettings.GetManagedStrippingLevel(BuildTargetGroup.iOS);
if (value == ManagedStrippingLevel.Disabled || value == ManagedStrippingLevel.Low)
- yield return context.Create(IssueCategory.ProjectSetting, k_iOSManagedStrippingDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_iOSManagedStrippingDescriptor.Id)
.WithLocation("Project/Player");
}
}
diff --git a/Editor/SettingsAnalysis/TargetArchitectureAnalyzer.cs b/Editor/SettingsAnalysis/TargetArchitectureAnalyzer.cs
index a8ddbd9a7a..bd47dfd2f9 100644
--- a/Editor/SettingsAnalysis/TargetArchitectureAnalyzer.cs
+++ b/Editor/SettingsAnalysis/TargetArchitectureAnalyzer.cs
@@ -19,7 +19,7 @@ class TargetArchitectureAnalyzer : ISettingsModuleAnalyzer
"In the iOS Player Settings, Architecture is set to Universal. This means that the application will be compiled for both 32-bit ARMv7 iOS devices (i.e. up to the iPhone 5 or 5c) and 64-bit ARM64 devices (iPhone 5s onwards), resulting in increased build times and binary size.",
"If your application isn't intended to support 32-bit iOS devices, change Architecture to ARM64.")
{
- platforms = new string[] { BuildTarget.iOS.ToString() }
+ Platforms = new string[] { BuildTarget.iOS.ToString() }
};
static readonly Descriptor k_DescriptorAndroid = new Descriptor(
@@ -29,7 +29,7 @@ class TargetArchitectureAnalyzer : ISettingsModuleAnalyzer
"In the Android Player Settings, in the Target Architecture section, both the ARMv7 and ARM64 options are selected. This means that the application will be compiled for both 32-bit ARMv7 Android devices and 64-bit ARM64 devices, resulting in increased build times and binary size.",
"If your application isn't intended to support 32-bit Android devices, disable the ARMv7 option.")
{
- platforms = new string[] { BuildTarget.Android.ToString() }
+ Platforms = new string[] { BuildTarget.Android.ToString() }
};
public void Initialize(Module module)
@@ -42,12 +42,12 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
// PlayerSettings.GetArchitecture returns an integer value associated with the architecture of a BuildTargetPlatformGroup. 0 - None, 1 - ARM64, 2 - Universal.
if (context.Params.Platform == BuildTarget.iOS && PlayerSettings.GetArchitecture(BuildTargetGroup.iOS) == 2)
- yield return context.Create(IssueCategory.ProjectSetting, k_DescriptorIOS.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DescriptorIOS.Id)
.WithLocation("Project/Player");
if (context.Params.Platform == BuildTarget.Android && (PlayerSettings.Android.targetArchitectures & AndroidArchitecture.ARMv7) != 0 &&
(PlayerSettings.Android.targetArchitectures & AndroidArchitecture.ARM64) != 0)
- yield return context.Create(IssueCategory.ProjectSetting, k_DescriptorAndroid.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_DescriptorAndroid.Id)
.WithLocation("Project/Player");
}
}
diff --git a/Editor/SettingsAnalysis/TimeSettingsAnalyzer.cs b/Editor/SettingsAnalysis/TimeSettingsAnalyzer.cs
index 743530d242..4b29ba5495 100644
--- a/Editor/SettingsAnalysis/TimeSettingsAnalyzer.cs
+++ b/Editor/SettingsAnalysis/TimeSettingsAnalyzer.cs
@@ -37,10 +37,10 @@ public void Initialize(Module module)
public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (UnityEngine.Time.fixedDeltaTime - 0.02f < Mathf.Epsilon)
- yield return context.Create(IssueCategory.ProjectSetting, k_FixedTimestepDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_FixedTimestepDescriptor.Id)
.WithLocation("Project/Time");
if (UnityEngine.Time.maximumDeltaTime - 0.1f < Mathf.Epsilon)
- yield return context.Create(IssueCategory.ProjectSetting, k_MaximumAllowedTimestepDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_MaximumAllowedTimestepDescriptor.Id)
.WithLocation("Project/Time");
}
}
diff --git a/Editor/SettingsAnalysis/UniversalRenderPipelineAnalyzer.cs b/Editor/SettingsAnalysis/UniversalRenderPipelineAnalyzer.cs
index 1797b85ef1..cee45814e2 100644
--- a/Editor/SettingsAnalysis/UniversalRenderPipelineAnalyzer.cs
+++ b/Editor/SettingsAnalysis/UniversalRenderPipelineAnalyzer.cs
@@ -24,7 +24,7 @@ class UniversalRenderPipelineAnalyzer : ISettingsModuleAnalyzer
"Graphics Settings do not refer to a URP Asset.",
"Check the settings: Graphics > Scriptable Render Pipeline Settings > Render Pipeline Asset.")
{
- messageFormat = "URP: URP Asset is not specified"
+ MessageFormat = "URP: URP Asset is not specified"
};
static readonly Descriptor k_HdrSettingDescriptor = new Descriptor(
@@ -34,8 +34,8 @@ class UniversalRenderPipelineAnalyzer : ISettingsModuleAnalyzer
"HDR (High Dynamic Range) is enabled in a URP Asset for mobile platforms. HDR rendering can be very intensive on low-end mobile GPUs.",
"Disable HDR in the URP Asset.")
{
- platforms = new[] {"Android", "iOS", "Switch"},
- messageFormat = "URP: HDR is enabled in {0}.asset in {1}",
+ Platforms = new[] {"Android", "iOS", "Switch"},
+ MessageFormat = "URP: HDR is enabled in {0}.asset in {1}",
fixer = FixHdrSetting
};
@@ -46,8 +46,8 @@ class UniversalRenderPipelineAnalyzer : ISettingsModuleAnalyzer
"Anti Aliasing (MSAA) is set to 4x or 8x in a URP Asset for mobile platforms. MSAA 4x/8x rendering can be intensive on low-end mobile GPUs.",
"Decrease Anti Aliasing (MSAA) value to 2x in the URP Asset.")
{
- platforms = new[] {"Android", "iOS", "Switch"},
- messageFormat = "URP: MSAA is set to 4x or 8x in {0}.asset in {1}",
+ Platforms = new[] {"Android", "iOS", "Switch"},
+ MessageFormat = "URP: MSAA is set to 4x or 8x in {0}.asset in {1}",
fixer = FixMsaaSampleCountSetting
};
@@ -59,7 +59,7 @@ class UniversalRenderPipelineAnalyzer : ISettingsModuleAnalyzer
"Disable Stop NaNs on as Camera components as you can."
)
{
- platforms = new[] { "Android", "iOS", "Switch" }
+ Platforms = new[] { "Android", "iOS", "Switch" }
};
public void Initialize(Module module)
@@ -76,7 +76,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
var renderPipeline = GraphicsSettings.currentRenderPipeline;
if (renderPipeline == null || !(renderPipeline is UniversalRenderPipelineAsset))
{
- yield return context.Create(IssueCategory.ProjectSetting, k_URPAssetDescriptor.id)
+ yield return context.Create(IssueCategory.ProjectSetting, k_URPAssetDescriptor.Id)
.WithLocation("Project/Graphics");
}
@@ -92,7 +92,7 @@ public IEnumerable Analyze(SettingsAnalysisContext context)
{
if (cameraData.stopNaN)
yield return context.Create(IssueCategory.ProjectSetting,
- k_CameraStopNanDescriptor.id);
+ k_CameraStopNanDescriptor.Id);
}
#else
yield break;
@@ -120,13 +120,13 @@ IEnumerable Analyze(SettingsAnalysisContext context, RenderPipelin
if (k_HdrSettingDescriptor.IsApplicable(context.Params) && GetHdrSetting(renderPipeline))
{
yield return RenderPipelineUtils.CreateAssetSettingIssue(context, qualityLevel, renderPipeline.name,
- k_HdrSettingDescriptor.id);
+ k_HdrSettingDescriptor.Id);
}
if (k_MsaaSampleCountSettingDescriptor.IsApplicable(context.Params) && GetMsaaSampleCountSetting(renderPipeline) >= 4)
{
yield return RenderPipelineUtils.CreateAssetSettingIssue(context, qualityLevel, renderPipeline.name,
- k_MsaaSampleCountSettingDescriptor.id);
+ k_MsaaSampleCountSettingDescriptor.Id);
}
#else
yield break;
diff --git a/Editor/UI/Framework/DiagnosticView.cs b/Editor/UI/Framework/DiagnosticView.cs
index f5d6ccce9a..a0e88b38e0 100644
--- a/Editor/UI/Framework/DiagnosticView.cs
+++ b/Editor/UI/Framework/DiagnosticView.cs
@@ -42,7 +42,7 @@ public override void DrawDetails(ProjectIssue[] selectedIssues)
GUILayout.Width(LayoutSize.CopyToClipboardButtonSize),
GUILayout.Height(LayoutSize.CopyToClipboardButtonSize)))
{
- EditorInterop.CopyToClipboard(Formatting.StripRichTextTags(descriptor.description));
+ EditorInterop.CopyToClipboard(Formatting.StripRichTextTags(descriptor.Description));
}
}
}
@@ -59,7 +59,7 @@ public override void DrawDetails(ProjectIssue[] selectedIssues)
GUILayout.MaxHeight(LayoutSize.FoldoutMaxHeight));
else
{
- GUILayout.TextArea(descriptor.description, SharedStyles.TextAreaWithDynamicSize,
+ GUILayout.TextArea(descriptor.Description, SharedStyles.TextAreaWithDynamicSize,
GUILayout.MaxHeight(LayoutSize.FoldoutMaxHeight));
}
@@ -78,7 +78,7 @@ public override void DrawDetails(ProjectIssue[] selectedIssues)
GUILayout.Width(LayoutSize.CopyToClipboardButtonSize),
GUILayout.Height(LayoutSize.CopyToClipboardButtonSize)))
{
- EditorInterop.CopyToClipboard(Formatting.StripRichTextTags(descriptor.solution));
+ EditorInterop.CopyToClipboard(Formatting.StripRichTextTags(descriptor.Solution));
}
}
}
@@ -95,7 +95,7 @@ public override void DrawDetails(ProjectIssue[] selectedIssues)
GUILayout.MaxHeight(LayoutSize.FoldoutMaxHeight));
else
{
- GUILayout.TextArea(descriptor.solution, SharedStyles.TextAreaWithDynamicSize,
+ GUILayout.TextArea(descriptor.Solution, SharedStyles.TextAreaWithDynamicSize,
GUILayout.MaxHeight(LayoutSize.FoldoutMaxHeight));
}
@@ -104,11 +104,11 @@ public override void DrawDetails(ProjectIssue[] selectedIssues)
var issuesAreIgnored = AreIssuesIgnored(selectedIssues);
if (numSelectedIDs == 1)
{
- if (!string.IsNullOrEmpty(descriptor.documentationUrl))
+ if (!string.IsNullOrEmpty(descriptor.DocumentationUrl))
{
DrawActionButton(Contents.Documentation, () =>
{
- Application.OpenURL(descriptor.documentationUrl);
+ Application.OpenURL(descriptor.DocumentationUrl);
m_ViewManager.OnSelectedIssuesDocumentationRequested?.Invoke(selectedIssues);
});
diff --git a/Editor/UI/Framework/EditorInterop.cs b/Editor/UI/Framework/EditorInterop.cs
index aadbfb8bf4..edddcfa346 100644
--- a/Editor/UI/Framework/EditorInterop.cs
+++ b/Editor/UI/Framework/EditorInterop.cs
@@ -22,10 +22,10 @@ public static void OpenCodeDescriptor(Descriptor descriptor)
return;
const string prefix = "UnityEngine.";
- if (descriptor.type.StartsWith(prefix))
+ if (descriptor.Type.StartsWith(prefix))
{
- var type = descriptor.type.Substring(prefix.Length);
- var method = descriptor.method;
+ var type = descriptor.Type.Substring(prefix.Length);
+ var method = descriptor.Method;
var url = string.Format("https://docs.unity3d.com/{0}.{1}/Documentation/ScriptReference/{2}{3}{4}.html",
unityVersion.Major, unityVersion.Minor, type, Char.IsUpper(method[0]) ? "." : "-", method);
Application.OpenURL(url);
@@ -36,9 +36,9 @@ public static void OpenCompilerMessageDescriptor(Descriptor descriptor)
{
const string prefix = "CS";
const string baseURL = "https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/";
- if (descriptor.title.StartsWith(prefix))
+ if (descriptor.Title.StartsWith(prefix))
{
- Application.OpenURL(baseURL + descriptor.title);
+ Application.OpenURL(baseURL + descriptor.Title);
}
}
diff --git a/Editor/UI/Framework/IssueTable.cs b/Editor/UI/Framework/IssueTable.cs
index 798bb80802..bfd139c3d8 100644
--- a/Editor/UI/Framework/IssueTable.cs
+++ b/Editor/UI/Framework/IssueTable.cs
@@ -514,7 +514,7 @@ void ShowContextMenu(Rect cellRect, IssueTableItem item, PropertyType propertyTy
}
var desc = item.ProjectIssue != null && item.ProjectIssue.Id.IsValid() ? item.ProjectIssue.Id.GetDescriptor() : null;
- if (m_Desc.onOpenManual != null && desc != null && desc.type.StartsWith("UnityEngine."))
+ if (m_Desc.onOpenManual != null && desc != null && desc.Type.StartsWith("UnityEngine."))
{
menu.AddItem(Utility.OpenScriptReference, false, () =>
{
diff --git a/Editor/UI/ProjectAuditorWindow.cs b/Editor/UI/ProjectAuditorWindow.cs
index 3914600368..7e846ef77a 100644
--- a/Editor/UI/ProjectAuditorWindow.cs
+++ b/Editor/UI/ProjectAuditorWindow.cs
@@ -196,7 +196,7 @@ public bool Match(ProjectIssue issue)
Profiler.BeginSample("MatchArea");
var matchArea = m_AreaSelection.ContainsGroup("All") ||
- (issue.Id.IsValid() && m_AreaSelection.ContainsAny(issue.Id.GetDescriptor().areas));
+ (issue.Id.IsValid() && m_AreaSelection.ContainsAny(issue.Id.GetDescriptor().Areas));
Profiler.EndSample();
if (!matchArea)
diff --git a/Editor/Utils/Json.cs b/Editor/Utils/Json.cs
index e84b4ad24a..dc7d481ed5 100644
--- a/Editor/Utils/Json.cs
+++ b/Editor/Utils/Json.cs
@@ -34,8 +34,8 @@ public static DateTime DeserializeDateTime(string utcDateTime)
public static T[] DeserializeArray(string json)
{
- var wrapper = JsonUtility.FromJson>(json);
- return wrapper.Items;
+ var array = JsonConvert.DeserializeObject(json, k_JsonSerializerSettings);
+ return array;
}
public static T[] DeserializeArrayFromFile(string fileName)
@@ -49,20 +49,12 @@ public static T[] DeserializeArrayFromFile(string fileName)
public static string SerializeArray(T[] array)
{
- var wrapper = new Wrapper {Items = array};
- return JsonUtility.ToJson(wrapper);
+ return JsonConvert.SerializeObject(array);
}
public static string SerializeArray(T[] array, bool prettyPrint)
{
- var wrapper = new Wrapper {Items = array};
- return JsonUtility.ToJson(wrapper, prettyPrint);
- }
-
- [Serializable]
- class Wrapper
- {
- public T[] Items;
+ return JsonConvert.SerializeObject(array, prettyPrint ? Newtonsoft.Json.Formatting.Indented : Newtonsoft.Json.Formatting.None);
}
}
}
diff --git a/Tests/Editor/AreaTests.cs b/Tests/Editor/AreaTests.cs
index 64939f56c8..332311291a 100644
--- a/Tests/Editor/AreaTests.cs
+++ b/Tests/Editor/AreaTests.cs
@@ -20,7 +20,7 @@ public void Area_Name_IsValid()
PlayerSettings.stripUnusedMeshComponents = false;
var issues = Analyze(IssueCategory.ProjectSetting, i =>
- i.Id.GetDescriptor().method.Equals("stripUnusedMeshComponents"));
+ i.Id.GetDescriptor().Method.Equals("stripUnusedMeshComponents"));
var issue = issues.FirstOrDefault();
Assert.NotNull(issue);
diff --git a/Tests/Editor/AudioClipTests.cs b/Tests/Editor/AudioClipTests.cs
index eb0022a4c9..90a07db521 100644
--- a/Tests/Editor/AudioClipTests.cs
+++ b/Tests/Editor/AudioClipTests.cs
@@ -109,7 +109,7 @@ public void AudioClip_LongNonStreaming_IsReportedAndFixed()
AudioCompressionFormat.PCM, AudioClipLoadType.DecompressOnLoad);
var issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLongClipDoesNotStreamDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLongClipDoesNotStreamDescriptor.Id));
Assert.NotNull(issue);
var descriptor = issue.Id.GetDescriptor();
@@ -119,7 +119,7 @@ public void AudioClip_LongNonStreaming_IsReportedAndFixed()
descriptor.Fix(issue);
issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLongClipDoesNotStreamDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLongClipDoesNotStreamDescriptor.Id));
Assert.Null(issue);
}
@@ -129,7 +129,7 @@ public void AudioClip_LongNonStreaming_IsReportedAndFixed()
public void AudioClip_ShortStreaming_IsReported()
{
var issue = AnalyzeAndFindAssetIssues(m_TestShortStreamingClipAsset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioShortClipStreamsDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioShortClipStreamsDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -149,7 +149,7 @@ public void AudioClip_StereoClipNotForcedToMonoOnMobile_IsReportedAndFixed()
AudioCompressionFormat.PCM, AudioClipLoadType.DecompressOnLoad);
var issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipsOnMobileDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipsOnMobileDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -159,7 +159,7 @@ public void AudioClip_StereoClipNotForcedToMonoOnMobile_IsReportedAndFixed()
descriptor.Fix(issue);
issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipsOnMobileDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipsOnMobileDescriptor.Id));
Assert.Null(issue);
@@ -175,7 +175,7 @@ public void AudioClip_NonStreamingStereoClipNotForcedToMono_IsReportedAndFixed()
AudioCompressionFormat.PCM, AudioClipLoadType.DecompressOnLoad);
var issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipWhichIsNotStreamingDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipWhichIsNotStreamingDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -185,7 +185,7 @@ public void AudioClip_NonStreamingStereoClipNotForcedToMono_IsReportedAndFixed()
descriptor.Fix(issue);
issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipWhichIsNotStreamingDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioStereoClipWhichIsNotStreamingDescriptor.Id));
Assert.Null(issue);
}
@@ -195,7 +195,7 @@ public void AudioClip_NonStreamingStereoClipNotForcedToMono_IsReportedAndFixed()
public void AudioClip_LongClipDecompressOnLoad_IsReported()
{
var issue = AnalyzeAndFindAssetIssues(m_TestLongNonStreamingClipAsset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLongDecompressedClipDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLongDecompressedClipDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -207,7 +207,7 @@ public void AudioClip_LongClipDecompressOnLoad_IsReported()
public void AudioClip_CompressedInMemory_IsReported()
{
var issue = AnalyzeAndFindAssetIssues(m_TestCompressedInMemoryClipAsset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioCompressedInMemoryDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioCompressedInMemoryDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -223,7 +223,7 @@ public void AudioClip_LargeCompressedOnMobile_IsReported()
m_Platform = BuildTarget.Android;
var issue = AnalyzeAndFindAssetIssues(m_TestCompressedInMemoryClipAsset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLargeCompressedMobileDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLargeCompressedMobileDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -242,7 +242,7 @@ public void AudioClip_HighBitrate_IsReportedAndFixed()
AudioCompressionFormat.PCM, AudioClipLoadType.DecompressOnLoad, true);
var issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_Audio48KHzDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_Audio48KHzDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -252,7 +252,7 @@ public void AudioClip_HighBitrate_IsReportedAndFixed()
descriptor.Fix(issue);
issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_Audio48KHzDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_Audio48KHzDescriptor.Id));
Assert.Null(issue);
}
@@ -266,7 +266,7 @@ public void AudioClip_PreloadAudioData_IsReportedAndFixed()
AudioCompressionFormat.PCM, AudioClipLoadType.DecompressOnLoad, true, true);
var issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioPreloadDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioPreloadDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -276,7 +276,7 @@ public void AudioClip_PreloadAudioData_IsReportedAndFixed()
descriptor.Fix(issue);
issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioPreloadDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioPreloadDescriptor.Id));
Assert.Null(issue);
}
@@ -290,7 +290,7 @@ public void AudioClip_LoadInBackGroundNotEnabled_IsReportedAndFixed()
AudioCompressionFormat.PCM, AudioClipLoadType.DecompressOnLoad);
var issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLoadInBackgroundDisabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLoadInBackgroundDisabledDescriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -300,7 +300,7 @@ public void AudioClip_LoadInBackGroundNotEnabled_IsReportedAndFixed()
descriptor.Fix(issue);
issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLoadInBackgroundDisabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioLoadInBackgroundDisabledDescriptor.Id));
Assert.Null(issue);
}
@@ -318,7 +318,7 @@ public void AudioClip_MP3Compression_IsReportedAndFixed()
AudioCompressionFormat.MP3, AudioClipLoadType.DecompressOnLoad);
var issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioMP3Descriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioMP3Descriptor.Id));
Assert.NotNull(issue);
Assert.IsTrue(issue.Id.IsValid());
@@ -328,7 +328,7 @@ public void AudioClip_MP3Compression_IsReportedAndFixed()
descriptor.Fix(issue);
issue = AnalyzeAndFindAssetIssues(asset, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioMP3Descriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(AudioClipAnalyzer.k_AudioMP3Descriptor.Id));
Assert.Null(issue);
diff --git a/Tests/Editor/CodeAnalysis/BoxingIssueTests.cs b/Tests/Editor/CodeAnalysis/BoxingIssueTests.cs
index 913d9433ed..f053b84811 100644
--- a/Tests/Editor/CodeAnalysis/BoxingIssueTests.cs
+++ b/Tests/Editor/CodeAnalysis/BoxingIssueTests.cs
@@ -54,11 +54,11 @@ public void CodeAnalysis_BoxingIntValue_IsReported()
Assert.AreEqual(BoxingAnalyzer.PAC2000, boxingInt.Id.ToString());
var descriptor = boxingInt.Id.GetDescriptor();
- Assert.AreEqual(Severity.Moderate, descriptor.defaultSeverity);
- Assert.True(string.IsNullOrEmpty(descriptor.type));
- Assert.True(string.IsNullOrEmpty(descriptor.method));
- Assert.False(string.IsNullOrEmpty(descriptor.title));
- Assert.AreEqual("Boxing Allocation", descriptor.title);
+ Assert.AreEqual(Severity.Moderate, descriptor.DefaultSeverity);
+ Assert.True(string.IsNullOrEmpty(descriptor.Type));
+ Assert.True(string.IsNullOrEmpty(descriptor.Method));
+ Assert.False(string.IsNullOrEmpty(descriptor.Title));
+ Assert.AreEqual("Boxing Allocation", descriptor.Title);
}
[Test]
@@ -84,11 +84,11 @@ public void CodeAnalysis_BoxingFloatValue_IsReported()
Assert.AreEqual(BoxingAnalyzer.PAC2000, boxingFloat.Id.ToString());
var descriptor = boxingFloat.Id.GetDescriptor();
- Assert.AreEqual(Severity.Moderate, descriptor.defaultSeverity);
- Assert.True(string.IsNullOrEmpty(descriptor.type));
- Assert.True(string.IsNullOrEmpty(descriptor.method));
- Assert.False(string.IsNullOrEmpty(descriptor.title));
- Assert.AreEqual("Boxing Allocation", descriptor.title);
+ Assert.AreEqual(Severity.Moderate, descriptor.DefaultSeverity);
+ Assert.True(string.IsNullOrEmpty(descriptor.Type));
+ Assert.True(string.IsNullOrEmpty(descriptor.Method));
+ Assert.False(string.IsNullOrEmpty(descriptor.Title));
+ Assert.AreEqual("Boxing Allocation", descriptor.Title);
}
[Test]
diff --git a/Tests/Editor/CodeAnalysis/CodeAnalysisTests.cs b/Tests/Editor/CodeAnalysis/CodeAnalysisTests.cs
index f4c9ef70f8..0af2c106c8 100644
--- a/Tests/Editor/CodeAnalysis/CodeAnalysisTests.cs
+++ b/Tests/Editor/CodeAnalysis/CodeAnalysisTests.cs
@@ -245,11 +245,11 @@ public void CodeAnalysis_Issue_IsReported()
Assert.NotNull(myIssue);
var descriptor = myIssue.Id.GetDescriptor();
- Assert.AreEqual(Severity.Moderate, descriptor.defaultSeverity);
+ Assert.AreEqual(Severity.Moderate, descriptor.DefaultSeverity);
Assert.AreEqual(typeof(DescriptorID), myIssue.Id.GetType());
Assert.AreEqual("PAC0066", myIssue.Id.ToString());
- Assert.AreEqual("UnityEngine.Camera", descriptor.type);
- Assert.AreEqual("allCameras", descriptor.method);
+ Assert.AreEqual("UnityEngine.Camera", descriptor.Type);
+ Assert.AreEqual("allCameras", descriptor.Method);
Assert.AreEqual(m_TestAsset.fileName, myIssue.Filename);
Assert.AreEqual("'UnityEngine.Camera.allCameras' usage", myIssue.Description);
@@ -378,7 +378,7 @@ public void CodeAnalysis_IssueInNamespace_IsReported()
Assert.NotNull(issue);
var descriptor = issue.Id.GetDescriptor();
- Assert.AreEqual("System.Linq.*", descriptor.title);
+ Assert.AreEqual("System.Linq.*", descriptor.Title);
}
[Test]
diff --git a/Tests/Editor/CodeAnalysis/EditorCodeAnalysisTests.cs b/Tests/Editor/CodeAnalysis/EditorCodeAnalysisTests.cs
index e38d28bd8a..3a78284c53 100644
--- a/Tests/Editor/CodeAnalysis/EditorCodeAnalysisTests.cs
+++ b/Tests/Editor/CodeAnalysis/EditorCodeAnalysisTests.cs
@@ -23,8 +23,8 @@ public void EditorCodeAnalysis_GetAssemblies_IsFound()
var issues = projectReport.FindByCategory(IssueCategory.Code);
var codeIssue = issues.FirstOrDefault(i => i.Id.IsValid() &&
- i.Id.GetDescriptor().type.Equals("System.AppDomain") &&
- i.Id.GetDescriptor().method.Equals("GetAssemblies") &&
+ i.Id.GetDescriptor().Type.Equals("System.AppDomain") &&
+ i.Id.GetDescriptor().Method.Equals("GetAssemblies") &&
i.GetCustomProperty(CodeProperty.Assembly).Equals("Unity.ProjectAuditor.Editor"));
Assert.NotNull(codeIssue);
@@ -43,8 +43,8 @@ public void EditorCodeAnalysis_FindAssets_IsFound()
var issues = projectReport.FindByCategory(IssueCategory.Code);
var codeIssue = issues.FirstOrDefault(i => i.Id.IsValid() &&
- i.Id.GetDescriptor().type.Equals("UnityEditor.AssetDatabase") &&
- i.Id.GetDescriptor().method.Equals("FindAssets") &&
+ i.Id.GetDescriptor().Type.Equals("UnityEditor.AssetDatabase") &&
+ i.Id.GetDescriptor().Method.Equals("FindAssets") &&
i.GetCustomProperty(CodeProperty.Assembly).Equals("Unity.ProjectAuditor.Editor"));
Assert.NotNull(codeIssue);
diff --git a/Tests/Editor/CodeAnalysis/LinqIssueTests.cs b/Tests/Editor/CodeAnalysis/LinqIssueTests.cs
index adf878f50f..fb82c2d9ed 100644
--- a/Tests/Editor/CodeAnalysis/LinqIssueTests.cs
+++ b/Tests/Editor/CodeAnalysis/LinqIssueTests.cs
@@ -43,10 +43,10 @@ public void CodeAnalysis_LinqIssue_IsReported()
Assert.NotNull(myIssue);
var descriptor = myIssue.Id.GetDescriptor();
- Assert.AreEqual(Severity.Moderate, descriptor.defaultSeverity);
+ Assert.AreEqual(Severity.Moderate, descriptor.DefaultSeverity);
Assert.AreEqual("PAC1000", myIssue.Id.ToString());
- Assert.AreEqual("System.Linq", descriptor.type);
- Assert.AreEqual("*", descriptor.method);
+ Assert.AreEqual("System.Linq", descriptor.Type);
+ Assert.AreEqual("*", descriptor.Method);
Assert.AreEqual(m_TestAsset.fileName, myIssue.Filename);
Assert.AreEqual("'System.Linq.Enumerable.Count' usage", myIssue.Description, "Description: {0}", myIssue.Description);
diff --git a/Tests/Editor/CodeAnalysis/MissingPlatformSupportTests.cs b/Tests/Editor/CodeAnalysis/MissingPlatformSupportTests.cs
index f8c07d616f..d2dbf3b18c 100644
--- a/Tests/Editor/CodeAnalysis/MissingPlatformSupportTests.cs
+++ b/Tests/Editor/CodeAnalysis/MissingPlatformSupportTests.cs
@@ -72,11 +72,11 @@ public void CodeAnalysis_MissingPlatformSupport_SystemNetIsReportedOnWebGL()
{
m_Platform = BuildTarget.WebGL;
- var diagnostic = AnalyzeAndFindAssetIssues(m_TestAssetSystemNet).FirstOrDefault(i => i.Id.Equals(UnsupportedOnWebGLAnalyzer.k_DescriptorSystemNet.id));
+ var diagnostic = AnalyzeAndFindAssetIssues(m_TestAssetSystemNet).FirstOrDefault(i => i.Id.Equals(UnsupportedOnWebGLAnalyzer.k_DescriptorSystemNet.Id));
Assert.NotNull(diagnostic);
Assert.AreEqual("'System.Boolean System.Net.Sockets.TcpClient::get_Connected()' usage", diagnostic.Description);
- Assert.Contains("Support", diagnostic.Id.GetDescriptor().areas);
+ Assert.Contains("Support", diagnostic.Id.GetDescriptor().Areas);
}
[Test]
@@ -85,11 +85,11 @@ public void CodeAnalysis_MissingPlatformSupport_SystemThreadingIsReportedOnWebGL
{
m_Platform = BuildTarget.WebGL;
- var diagnostic = AnalyzeAndFindAssetIssues(m_TestAssetSystemThreading).FirstOrDefault(i => i.Id.Equals(UnsupportedOnWebGLAnalyzer.k_DescriptorSystemThreading.id));
+ var diagnostic = AnalyzeAndFindAssetIssues(m_TestAssetSystemThreading).FirstOrDefault(i => i.Id.Equals(UnsupportedOnWebGLAnalyzer.k_DescriptorSystemThreading.Id));
Assert.NotNull(diagnostic);
Assert.AreEqual("'System.Void System.Threading.Thread::Sleep(System.Int32)' usage", diagnostic.Description);
- Assert.Contains("Support", diagnostic.Id.GetDescriptor().areas);
+ Assert.Contains("Support", diagnostic.Id.GetDescriptor().Areas);
}
[Test]
@@ -98,11 +98,11 @@ public void CodeAnalysis_MissingPlatformSupport_MicrophoneIsReportedOnWebGL()
{
m_Platform = BuildTarget.WebGL;
- var diagnostic = AnalyzeAndFindAssetIssues(m_TestAssetMicrophone).FirstOrDefault(i => i.Id.Equals(UnsupportedOnWebGLAnalyzer.k_DescriptorMicrophone.id));
+ var diagnostic = AnalyzeAndFindAssetIssues(m_TestAssetMicrophone).FirstOrDefault(i => i.Id.Equals(UnsupportedOnWebGLAnalyzer.k_DescriptorMicrophone.Id));
Assert.NotNull(diagnostic);
Assert.AreEqual("'System.String[] UnityEngine.Microphone::get_devices()' usage", diagnostic.Description);
- Assert.Contains("Support", diagnostic.Id.GetDescriptor().areas);
+ Assert.Contains("Support", diagnostic.Id.GetDescriptor().Areas);
}
[Test]
diff --git a/Tests/Editor/CodeAnalysis/MonoBehaviourEmptyMethodTests.cs b/Tests/Editor/CodeAnalysis/MonoBehaviourEmptyMethodTests.cs
index 5c07960feb..3170fc36fa 100644
--- a/Tests/Editor/CodeAnalysis/MonoBehaviourEmptyMethodTests.cs
+++ b/Tests/Editor/CodeAnalysis/MonoBehaviourEmptyMethodTests.cs
@@ -46,10 +46,10 @@ public void CodeAnalysis_MonoBehaviourWithEmptyEventMethod_IsReported(CodeOptimi
Assert.NotNull(issue);
var descriptor = issue.Id.GetDescriptor();
- Assert.AreEqual(Severity.Moderate, descriptor.defaultSeverity);
+ Assert.AreEqual(Severity.Moderate, descriptor.DefaultSeverity);
Assert.AreEqual(EmptyMethodAnalyzer.GetDescriptorID(), issue.Id.ToString());
- Assert.True(string.IsNullOrEmpty(descriptor.type));
- Assert.True(string.IsNullOrEmpty(descriptor.method));
+ Assert.True(string.IsNullOrEmpty(descriptor.Type));
+ Assert.True(string.IsNullOrEmpty(descriptor.Method));
Assert.AreEqual(m_MonoBehaviourWithEmptyEventMethod.fileName, issue.Filename);
Assert.AreEqual("MonoBehaviour method 'Update' is empty", issue.Description);
diff --git a/Tests/Editor/DiagnosticDescriptorTests.cs b/Tests/Editor/DiagnosticDescriptorTests.cs
index 7137cfae52..c38fbde94b 100644
--- a/Tests/Editor/DiagnosticDescriptorTests.cs
+++ b/Tests/Editor/DiagnosticDescriptorTests.cs
@@ -31,7 +31,7 @@ class DiagnosticDescriptorTests
[OneTimeSetUp]
public void Setup()
{
- DescriptorLibrary.RegisterDescriptor(m_Descriptor.id, m_Descriptor);
+ DescriptorLibrary.RegisterDescriptor(m_Descriptor.Id, m_Descriptor);
}
[Test]
@@ -75,7 +75,7 @@ public void DiagnosticDescriptor_Hash_IsId()
"do nothing"
);
- Assert.AreEqual(p.id.GetHashCode(), p.GetHashCode());
+ Assert.AreEqual(p.Id.GetHashCode(), p.GetHashCode());
}
[Test]
@@ -93,40 +93,40 @@ public void DiagnosticDescriptor_Version_IsCompatible()
// check default values
Assert.True(desc.IsVersionCompatible());
- desc.minimumVersion = string.Empty;
- desc.maximumVersion = string.Empty;
+ desc.MinimumVersion = string.Empty;
+ desc.MaximumVersion = string.Empty;
Assert.True(desc.IsVersionCompatible());
- desc.minimumVersion = "0.0";
- desc.maximumVersion = null;
+ desc.MinimumVersion = "0.0";
+ desc.MaximumVersion = null;
Assert.True(desc.IsVersionCompatible());
- desc.minimumVersion = null;
- desc.maximumVersion = "0.0";
+ desc.MinimumVersion = null;
+ desc.MaximumVersion = "0.0";
Assert.False(desc.IsVersionCompatible());
- desc.minimumVersion = null;
- desc.maximumVersion = "9999.9";
+ desc.MinimumVersion = null;
+ desc.MaximumVersion = "9999.9";
Assert.True(desc.IsVersionCompatible());
- desc.minimumVersion = "9999.9";
- desc.maximumVersion = null;
+ desc.MinimumVersion = "9999.9";
+ desc.MaximumVersion = null;
Assert.False(desc.IsVersionCompatible());
var unityVersionString = Application.unityVersion;
unityVersionString = unityVersionString.Remove(
Regex.Match(unityVersionString, "[A-Za-z]").Index);
- desc.minimumVersion = unityVersionString;
- desc.maximumVersion = null;
+ desc.MinimumVersion = unityVersionString;
+ desc.MaximumVersion = null;
Assert.True(desc.IsVersionCompatible());
- desc.minimumVersion = null;
- desc.maximumVersion = unityVersionString;
+ desc.MinimumVersion = null;
+ desc.MaximumVersion = unityVersionString;
Assert.True(desc.IsVersionCompatible());
- desc.minimumVersion = "1.1";
- desc.maximumVersion = "1.0";
+ desc.MinimumVersion = "1.1";
+ desc.MaximumVersion = "1.0";
var result = desc.IsVersionCompatible();
LogAssert.Expect(LogType.Error, "Descriptor (TDD2001) minimumVersion (1.1) is greater than maximumVersion (1.0).");
Assert.False(result);
@@ -175,7 +175,7 @@ public void DiagnosticDescriptor_Platform_IsCompatible()
"do nothing"
)
{
- platforms = new[] { TestFixtureBase.GetStandaloneBuildTarget().ToString() }
+ Platforms = new[] { TestFixtureBase.GetStandaloneBuildTarget().ToString() }
};
Assert.True(desc.IsPlatformSupported());
@@ -193,7 +193,7 @@ public void DiagnosticDescriptor_Platform_IsNotCompatible()
"do nothing"
)
{
- platforms = new[] { BuildTarget.WSAPlayer.ToString() } // assuming WSAPlayer is not installed by default
+ Platforms = new[] { BuildTarget.WSAPlayer.ToString() } // assuming WSAPlayer is not installed by default
};
Assert.False(desc.IsPlatformSupported());
@@ -208,10 +208,10 @@ public void DiagnosticDescriptor_Descriptor_IsRegistered()
var IDs = projectAuditor.GetDiagnosticIDs();
- Assert.NotZero(IDs.Count(id => id.AsString() == m_Descriptor.id), "Descriptor {0} is not registered", m_Descriptor.id);
+ Assert.NotZero(IDs.Count(id => id.AsString() == m_Descriptor.Id), "Descriptor {0} is not registered", m_Descriptor.Id);
// This will throw an exception if the Descriptor is somehow registered in the module but not in the DescriptorLibrary
- var descriptor = new DescriptorID(m_Descriptor.id).GetDescriptor();
+ var descriptor = new DescriptorID(m_Descriptor.Id).GetDescriptor();
}
[Test]
@@ -224,13 +224,13 @@ public void DiagnosticDescriptor_Descriptors_AreValid()
foreach (var id in IDs)
{
var descriptor = id.GetDescriptor();
- Assert.IsFalse(string.IsNullOrEmpty(descriptor.id), "Descriptor has no id (title: {0})", descriptor.title);
- Assert.IsTrue(regExp.IsMatch(descriptor.id), "Descriptor id format is not valid: " + descriptor.id);
- Assert.IsFalse(string.IsNullOrEmpty(descriptor.title), "Descriptor {0} has no title", descriptor.id);
- Assert.IsFalse(string.IsNullOrEmpty(descriptor.description), "Descriptor {0} has no description", descriptor.id);
- Assert.IsFalse(string.IsNullOrEmpty(descriptor.solution), "Descriptor {0} has no solution", descriptor.id);
+ Assert.IsFalse(string.IsNullOrEmpty(descriptor.Id), "Descriptor has no id (title: {0})", descriptor.Title);
+ Assert.IsTrue(regExp.IsMatch(descriptor.Id), "Descriptor id format is not valid: " + descriptor.Id);
+ Assert.IsFalse(string.IsNullOrEmpty(descriptor.Title), "Descriptor {0} has no title", descriptor.Id);
+ Assert.IsFalse(string.IsNullOrEmpty(descriptor.Description), "Descriptor {0} has no description", descriptor.Id);
+ Assert.IsFalse(string.IsNullOrEmpty(descriptor.Solution), "Descriptor {0} has no solution", descriptor.Id);
- Assert.NotNull(descriptor.areas);
+ Assert.NotNull(descriptor.Areas);
}
}
@@ -242,15 +242,15 @@ public void DiagnosticDescriptor_Descriptors_AreFormatted()
foreach (var id in IDs)
{
var descriptor = id.GetDescriptor();
- Assert.IsFalse(descriptor.title.EndsWith("."), "Descriptor {0} string must not end with a full stop. String: {1}", descriptor.id, descriptor.title);
- Assert.IsTrue(descriptor.description.EndsWith("."), "Descriptor {0} string must end with a full stop. String: {1}", descriptor.id, descriptor.description);
- Assert.IsTrue(descriptor.solution.EndsWith("."), "Descriptor {0} string must end with a full stop. String: {1}", descriptor.id, descriptor.solution);
- Assert.IsFalse(descriptor.messageFormat.EndsWith("."), "Descriptor {0} string must not end with a full stop. String: {1}", descriptor.id, descriptor.messageFormat);
+ Assert.IsFalse(descriptor.Title.EndsWith("."), "Descriptor {0} string must not end with a full stop. String: {1}", descriptor.Id, descriptor.Title);
+ Assert.IsTrue(descriptor.Description.EndsWith("."), "Descriptor {0} string must end with a full stop. String: {1}", descriptor.Id, descriptor.Description);
+ Assert.IsTrue(descriptor.Solution.EndsWith("."), "Descriptor {0} string must end with a full stop. String: {1}", descriptor.Id, descriptor.Solution);
+ Assert.IsFalse(descriptor.MessageFormat.EndsWith("."), "Descriptor {0} string must not end with a full stop. String: {1}", descriptor.Id, descriptor.MessageFormat);
- CheckHtmlTags(descriptor.description);
- CheckHtmlTags(descriptor.solution);
+ CheckHtmlTags(descriptor.Description);
+ CheckHtmlTags(descriptor.Solution);
- Assert.NotNull(descriptor.areas);
+ Assert.NotNull(descriptor.Areas);
}
}
@@ -321,8 +321,8 @@ public void DiagnosticDescriptor_Descriptors_AreRegistered(string jsonFilename)
// (We know incompatible Descriptors won't be registered in our instance of ProjectAuditor)
if (loadedDescriptor.IsPlatformSupported() && loadedDescriptor.IsVersionCompatible())
{
- Assert.NotZero(IDs.Count(id => id.AsString() == loadedDescriptor.id),
- "Descriptor {0} is not registered", loadedDescriptor.id);
+ Assert.NotZero(IDs.Count(id => id.AsString() == loadedDescriptor.Id),
+ "Descriptor {0} is not registered", loadedDescriptor.Id);
}
}
}
@@ -350,16 +350,16 @@ public void DiagnosticDescriptor_TypeAndMethods_Exist(string jsonFilename)
if (!desc.IsPlatformSupported() || !desc.IsVersionCompatible())
continue;
- var type = types.FirstOrDefault(t => t.FullName.Equals(desc.type));
+ var type = types.FirstOrDefault(t => t.FullName.Equals(desc.Type));
- Assert.True((desc.method.Equals("*") || type != null), "Invalid Type : " + desc.type);
+ Assert.True((desc.Method.Equals("*") || type != null), "Invalid Type : " + desc.Type);
- if (skippableMethodNames.Contains(desc.method))
+ if (skippableMethodNames.Contains(desc.Method))
continue;
try
{
- Assert.True(type.GetMethod(desc.method) != null || type.GetProperty(desc.method) != null, "{0} does not belong to {1}", desc.method, desc.type);
+ Assert.True(type.GetMethod(desc.Method) != null || type.GetProperty(desc.Method) != null, "{0} does not belong to {1}", desc.Method, desc.Type);
}
catch (AmbiguousMatchException)
{
@@ -377,10 +377,10 @@ public void DiagnosticDescriptor_Areas_Exist()
foreach (var id in IDs)
{
var descriptor = id.GetDescriptor();
- for (int i = 0; i < descriptor.areas.Length; i++)
+ for (int i = 0; i < descriptor.Areas.Length; i++)
{
Area area;
- Assert.True(Enum.TryParse(descriptor.areas[i], out area), "Invalid area {0} for descriptor {1}", descriptor.areas[i], descriptor.id);
+ Assert.True(Enum.TryParse(descriptor.Areas[i], out area), "Invalid area {0} for descriptor {1}", descriptor.Areas[i], descriptor.Id);
}
}
}
@@ -396,10 +396,10 @@ public IEnumerator DiagnosticDescriptor_DocumentationUrl_Exist()
{
var descriptor = id.GetDescriptor();
- if (string.IsNullOrEmpty(descriptor.documentationUrl))
+ if (string.IsNullOrEmpty(descriptor.DocumentationUrl))
continue;
- var documentationUrl = descriptor.documentationUrl;
+ var documentationUrl = descriptor.DocumentationUrl;
var request = UnityWebRequest.Get(documentationUrl);
yield return request.SendWebRequest();
diff --git a/Tests/Editor/DiagnosticParamsTests.cs b/Tests/Editor/DiagnosticParamsTests.cs
index 6bfb46daf3..22dab89008 100644
--- a/Tests/Editor/DiagnosticParamsTests.cs
+++ b/Tests/Editor/DiagnosticParamsTests.cs
@@ -85,7 +85,7 @@ public void DiagnosticParams_CustomDiagnosticParamsImpactReports()
var foundIssues = report.GetAllIssues().Where(i => i.RelativePath.Equals(m_TestTextureAsset.relativePath));
Assert.NotNull(foundIssues);
- Assert.Null(foundIssues.FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.id)));
+ Assert.Null(foundIssues.FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.Id)));
// Texture would normally be too small to trigger this diagnostic, unless we specify a custom smaller limit
analysisParams.DiagnosticParams.SetParameter(BuildTarget.NoTarget, k_TextureStreamingMipmapsSizeLimit, 32);
@@ -93,7 +93,7 @@ public void DiagnosticParams_CustomDiagnosticParamsImpactReports()
foundIssues = report.GetAllIssues().Where(i => i.RelativePath.Equals(m_TestTextureAsset.relativePath));
Assert.NotNull(foundIssues);
- Assert.NotNull(foundIssues.FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.id)));
+ Assert.NotNull(foundIssues.FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.Id)));
}
[Test]
diff --git a/Tests/Editor/ModuleTests.cs b/Tests/Editor/ModuleTests.cs
index 541452db84..84ca76da7f 100644
--- a/Tests/Editor/ModuleTests.cs
+++ b/Tests/Editor/ModuleTests.cs
@@ -38,7 +38,7 @@ public IEnumerable GetLayouts()
[OneTimeSetUp]
public void SetUp()
{
- DescriptorLibrary.RegisterDescriptor(k_Descriptor.id, k_Descriptor);
+ DescriptorLibrary.RegisterDescriptor(k_Descriptor.Id, k_Descriptor);
}
public void Reload(string path)
@@ -51,7 +51,7 @@ public void RegisterDescriptor(Descriptor descriptor)
public void Audit(Action onIssueFound, Action onComplete, IProgress progress = null)
{
- onIssueFound(new ProjectIssue(IssueCategory.Code, k_Descriptor.id, "This is a test issue"));
+ onIssueFound(new ProjectIssue(IssueCategory.Code, k_Descriptor.Id, "This is a test issue"));
onComplete();
}
}
diff --git a/Tests/Editor/ProjectIssueTests.cs b/Tests/Editor/ProjectIssueTests.cs
index 1c9f00136e..dcbb215d51 100644
--- a/Tests/Editor/ProjectIssueTests.cs
+++ b/Tests/Editor/ProjectIssueTests.cs
@@ -33,7 +33,7 @@ class ProjectIssueTests
"do nothing"
)
{
- messageFormat = "this is a message with argument {0}"
+ MessageFormat = "this is a message with argument {0}"
};
Descriptor m_CriticalIssueDescriptor = new Descriptor
@@ -45,7 +45,7 @@ class ProjectIssueTests
"do nothing"
)
{
- defaultSeverity = Severity.Critical
+ DefaultSeverity = Severity.Critical
};
[SerializeField]
@@ -54,9 +54,9 @@ class ProjectIssueTests
[OneTimeSetUp]
public void SetUp()
{
- DescriptorLibrary.RegisterDescriptor(m_Descriptor.id, m_Descriptor);
- DescriptorLibrary.RegisterDescriptor(m_DescriptorWithMessage.id, m_DescriptorWithMessage);
- DescriptorLibrary.RegisterDescriptor(m_CriticalIssueDescriptor.id, m_CriticalIssueDescriptor);
+ DescriptorLibrary.RegisterDescriptor(m_Descriptor.Id, m_Descriptor);
+ DescriptorLibrary.RegisterDescriptor(m_DescriptorWithMessage.Id, m_DescriptorWithMessage);
+ DescriptorLibrary.RegisterDescriptor(m_CriticalIssueDescriptor.Id, m_CriticalIssueDescriptor);
}
[Test]
@@ -77,7 +77,7 @@ public void ProjectIssue_NewIssue_IsInitialized()
public void ProjectIssue_NewIssue_IsNotFormatted()
{
var description = "a title";
- var diagnostic = new ProjectIssue(IssueCategory.Code, m_Descriptor.id, "dummy");
+ var diagnostic = new ProjectIssue(IssueCategory.Code, m_Descriptor.Id, "dummy");
Assert.AreEqual(string.Empty, diagnostic.Filename);
Assert.AreEqual(string.Empty, diagnostic.RelativePath);
Assert.AreEqual(string.Empty, diagnostic.GetContext());
@@ -90,7 +90,7 @@ public void ProjectIssue_NewIssue_IsNotFormatted()
[Test]
public void ProjectIssue_NewIssue_IsFormatted()
{
- var diagnostic = new ProjectIssue(IssueCategory.Code, m_DescriptorWithMessage.id, "dummy");
+ var diagnostic = new ProjectIssue(IssueCategory.Code, m_DescriptorWithMessage.Id, "dummy");
Assert.AreEqual(string.Empty, diagnostic.Filename);
Assert.AreEqual(string.Empty, diagnostic.RelativePath);
Assert.AreEqual(string.Empty, diagnostic.GetContext());
@@ -104,7 +104,7 @@ public void ProjectIssue_NewIssue_IsFormatted()
public void ProjectIssue_NewIssue_IsCritical()
{
var description = "a title of a critical problem";
- var diagnostic = new ProjectIssue(IssueCategory.Code, m_CriticalIssueDescriptor.id, description);
+ var diagnostic = new ProjectIssue(IssueCategory.Code, m_CriticalIssueDescriptor.Id, description);
Assert.AreEqual(string.Empty, diagnostic.Filename);
Assert.AreEqual(string.Empty, diagnostic.RelativePath);
Assert.AreEqual(string.Empty, diagnostic.GetContext());
@@ -119,7 +119,7 @@ public void ProjectIssue_NewIssue_IsCritical()
[UnityTest]
public IEnumerator ProjectIssue_Priority_PersistsAfterDomainReload()
{
- m_Issue = new ProjectIssue(IssueCategory.Code, m_Descriptor.id);
+ m_Issue = new ProjectIssue(IssueCategory.Code, m_Descriptor.Id);
m_Issue.Severity = Severity.Major;
#if UNITY_2019_3_OR_NEWER
@@ -141,7 +141,7 @@ public void ProjectIssue_CustomProperties_AreSet()
"property #1"
};
var context = new AnalysisContext();
- var issue = (ProjectIssue)context.Create(IssueCategory.Code, m_Descriptor.id)
+ var issue = (ProjectIssue)context.Create(IssueCategory.Code, m_Descriptor.Id)
.WithCustomProperties(properties);
Assert.AreEqual(2, issue.GetNumCustomProperties());
@@ -152,7 +152,7 @@ public void ProjectIssue_CustomProperties_AreSet()
[Test]
public void ProjectIssue_CustomProperties_AreNotSet()
{
- var issue = new ProjectIssue(IssueCategory.Code, m_Descriptor.id);
+ var issue = new ProjectIssue(IssueCategory.Code, m_Descriptor.Id);
Assert.AreEqual(0, issue.GetNumCustomProperties());
}
@@ -167,7 +167,7 @@ public void ProjectIssue_Properties_AreSet()
};
var description = "a title";
var context = new AnalysisContext();
- var issue = (ProjectIssue)context.Create(IssueCategory.Code, m_Descriptor.id)
+ var issue = (ProjectIssue)context.Create(IssueCategory.Code, m_Descriptor.Id)
.WithCustomProperties(properties)
.WithLocation("Assets/Dummy.cs");
@@ -187,7 +187,7 @@ public void ProjectIssue_Properties_AreSet()
[Test]
public void ProjectIssue_NoFileProperties_AreSet()
{
- var issue = new ProjectIssue(IssueCategory.Code, m_Descriptor.id);
+ var issue = new ProjectIssue(IssueCategory.Code, m_Descriptor.Id);
Assert.AreEqual(ProjectIssueExtensions.k_NotAvailable, issue.GetProperty(PropertyType.Path));
Assert.AreEqual(ProjectIssueExtensions.k_NotAvailable, issue.GetProperty(PropertyType.Filename));
@@ -201,7 +201,7 @@ public void ProjectIssue_NoFileProperties_AreSet()
public void ProjectIssue_Issue_IsCreatedWithLogLevel(LogLevel logLevel)
{
var context = new AnalysisContext();
- ProjectIssue issue = context.Create(IssueCategory.Code, m_Descriptor.id)
+ ProjectIssue issue = context.Create(IssueCategory.Code, m_Descriptor.Id)
.WithLogLevel(logLevel);
Assert.AreEqual(logLevel, issue.LogLevel);
diff --git a/Tests/Editor/ProjectReportSerializationTests.cs b/Tests/Editor/ProjectReportSerializationTests.cs
index d99a7cfcad..c4c213587f 100644
--- a/Tests/Editor/ProjectReportSerializationTests.cs
+++ b/Tests/Editor/ProjectReportSerializationTests.cs
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -126,6 +127,14 @@ public void ProjectReportSerialization_Report_CanSerialize()
if (property is JObject issue)
{
AssertRequiredPropertyIsValid(issue, "category");
+
+ var issueCategory = (IssueCategory)Enum.Parse(typeof(IssueCategory), issue["category"].Value());
+ if (issueCategory.Equals(IssueCategory.Code) ||
+ issueCategory.Equals(IssueCategory.ProjectSetting) ||
+ issueCategory.Equals(IssueCategory.AssetDiagnostic))
+ {
+ AssertRequiredProperty(issue, "diagnosticID");
+ }
AssertRequiredPropertyIsValid(issue, "description");
AssertOptionalArrayIsValid(issue, "properties");
diff --git a/Tests/Editor/ProjectReportTests.cs b/Tests/Editor/ProjectReportTests.cs
index fd70fa18fc..d0f97f3e34 100644
--- a/Tests/Editor/ProjectReportTests.cs
+++ b/Tests/Editor/ProjectReportTests.cs
@@ -32,7 +32,7 @@ class ProjectReportTests : TestFixtureBase
[OneTimeSetUp]
public void SetUp()
{
- DescriptorLibrary.RegisterDescriptor(m_Descriptor.id, m_Descriptor);
+ DescriptorLibrary.RegisterDescriptor(m_Descriptor.Id, m_Descriptor);
m_TestAsset = new TestAsset("MyClass.cs", @"
using UnityEngine;
diff --git a/Tests/Editor/SettingsAnalysisTests.cs b/Tests/Editor/SettingsAnalysisTests.cs
index e49bdeb4e4..b817b2b690 100644
--- a/Tests/Editor/SettingsAnalysisTests.cs
+++ b/Tests/Editor/SettingsAnalysisTests.cs
@@ -369,7 +369,7 @@ public void SettingsAnalysis_Issue_IsReported()
PlayerSettings.bakeCollisionMeshes = false;
var issues = Analyze(IssueCategory.ProjectSetting, i =>
- i.Id.IsValid() && i.Id.GetDescriptor().method.Equals("bakeCollisionMeshes"));
+ i.Id.IsValid() && i.Id.GetDescriptor().Method.Equals("bakeCollisionMeshes"));
var playerSettingIssue = issues.FirstOrDefault();
var descriptor = playerSettingIssue.Id.GetDescriptor();
@@ -888,7 +888,7 @@ void TestSrpBatchingSetting(RenderPipelineAsset renderPipeline, int qualityLevel
SrpAssetSettingsAnalyzer.SetSrpBatcherSetting(renderPipeline, false);
var issues = Analyze(IssueCategory.ProjectSetting,
- i => i.Id.IsValid() && i.Id.GetDescriptor().id == SrpAssetSettingsAnalyzer.PAS1008);
+ i => i.Id.IsValid() && i.Id.GetDescriptor().Id == SrpAssetSettingsAnalyzer.PAS1008);
var srpBatchingIssue = issues.FirstOrDefault();
Assert.NotNull(srpBatchingIssue);
Assert.IsTrue(issues.Any(i => i.GetCustomPropertyInt32(0) == qualityLevel),
@@ -896,7 +896,7 @@ void TestSrpBatchingSetting(RenderPipelineAsset renderPipeline, int qualityLevel
SrpAssetSettingsAnalyzer.SetSrpBatcherSetting(renderPipeline, true);
issues = Analyze(IssueCategory.ProjectSetting,
- i => i.Id.IsValid() && i.Id.GetDescriptor().id == SrpAssetSettingsAnalyzer.PAS1008);
+ i => i.Id.IsValid() && i.Id.GetDescriptor().Id == SrpAssetSettingsAnalyzer.PAS1008);
Assert.IsFalse(issues.Any(i => i.GetCustomPropertyInt32(0) == qualityLevel),
$"Render Pipeline with quality level {qualityLevel} should have enabled SRP Batcher.");
diff --git a/Tests/Editor/SpriteAtlasTests.cs b/Tests/Editor/SpriteAtlasTests.cs
index f4c7c8afcc..222570b9c9 100644
--- a/Tests/Editor/SpriteAtlasTests.cs
+++ b/Tests/Editor/SpriteAtlasTests.cs
@@ -80,7 +80,7 @@ public void SpriteAtlas_Not_Empty_Is_Not_Reported()
{
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestSpriteAtlasFull, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(SpriteAtlasAnalyzer.k_SpriteAtlasEmptyDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(SpriteAtlasAnalyzer.k_SpriteAtlasEmptyDescriptor.Id));
Assert.Null(textureDiagnostic);
}
@@ -91,7 +91,7 @@ public void SpriteAtlas_Empty_Is_Reported()
{
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestSpriteAtlasEmpty, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(SpriteAtlasAnalyzer.k_SpriteAtlasEmptyDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(SpriteAtlasAnalyzer.k_SpriteAtlasEmptyDescriptor.Id));
Assert.IsNotNull(textureDiagnostic);
}
diff --git a/Tests/Editor/TextureTests.cs b/Tests/Editor/TextureTests.cs
index 2f77b45e28..9445c39ff6 100644
--- a/Tests/Editor/TextureTests.cs
+++ b/Tests/Editor/TextureTests.cs
@@ -48,19 +48,19 @@ public void SetUp()
{
m_AdditionalRules.Add(new Rule
{
- id = TextureUtilizationAnalyzer.k_TextureSolidColorDescriptor.id,
+ id = TextureUtilizationAnalyzer.k_TextureSolidColorDescriptor.Id,
severity = Severity.Moderate
});
m_AdditionalRules.Add(new Rule
{
- id = TextureUtilizationAnalyzer.k_TextureSolidColorNoFixerDescriptor.id,
+ id = TextureUtilizationAnalyzer.k_TextureSolidColorNoFixerDescriptor.Id,
severity = Severity.Moderate
});
m_AdditionalRules.Add(new Rule
{
- id = TextureUtilizationAnalyzer.k_TextureAtlasEmptyDescriptor.id,
+ id = TextureUtilizationAnalyzer.k_TextureAtlasEmptyDescriptor.Id,
severity = Severity.Moderate
});
@@ -216,7 +216,7 @@ public void Texture_MipMapUnused_IsReported()
{
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureNoMipMapDefault, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapNotEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapNotEnabledDescriptor.Id));
Assert.NotNull(textureDiagnostic);
}
@@ -225,7 +225,7 @@ public void Texture_MipMapUnused_IsReported()
public void Texture_MipMapUnused_IsNotReported()
{
var textureDiagnostic = AnalyzeAndFindAssetIssues(m_TestTextureMipMapDefault, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapNotEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapNotEnabledDescriptor.Id));
Assert.Null(textureDiagnostic);
}
@@ -234,7 +234,7 @@ public void Texture_MipMapUnused_IsNotReported()
public void Texture_MipMapUsedForGUI_IsReported()
{
var textureDiagnostic = AnalyzeAndFindAssetIssues(m_TestTextureMipMapGui, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.Id));
Assert.NotNull(textureDiagnostic);
var descriptor = textureDiagnostic.Id.GetDescriptor();
@@ -244,7 +244,7 @@ public void Texture_MipMapUsedForGUI_IsReported()
descriptor.Fix(textureDiagnostic);
textureDiagnostic = AnalyzeAndFindAssetIssues(m_TestTextureMipMapGui, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.Id));
Assert.Null(textureDiagnostic);
}
@@ -253,7 +253,7 @@ public void Texture_MipMapUsedForGUI_IsReported()
public void Texture_MipMapUsedForSprite_IsReportedAndFixed()
{
var textureDiagnostic = AnalyzeAndFindAssetIssues(m_TestTextureMipMapSprite, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.Id));
Assert.NotNull(textureDiagnostic);
var descriptor = textureDiagnostic.Id.GetDescriptor();
@@ -263,7 +263,7 @@ public void Texture_MipMapUsedForSprite_IsReportedAndFixed()
descriptor.Fix(textureDiagnostic);
textureDiagnostic = AnalyzeAndFindAssetIssues(m_TestTextureMipMapSprite, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureMipMapEnabledDescriptor.Id));
Assert.Null(textureDiagnostic);
}
@@ -273,7 +273,7 @@ public void Texture_ReadWriteEnabled_IsReported()
{
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureReadWriteEnabled, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureReadWriteEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureReadWriteEnabledDescriptor.Id));
Assert.NotNull(textureDiagnostic);
var descriptor = textureDiagnostic.Id.GetDescriptor();
@@ -283,7 +283,7 @@ public void Texture_ReadWriteEnabled_IsReported()
descriptor.Fix(textureDiagnostic);
textureDiagnostic = AnalyzeAndFindAssetIssues(m_TestTextureReadWriteEnabled, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureReadWriteEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureReadWriteEnabledDescriptor.Id));
Assert.Null(textureDiagnostic);
}
@@ -293,7 +293,7 @@ public void Texture_ReadWriteEnabled_IsNotReported()
{
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureNoMipMapDefault, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureReadWriteEnabledDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureReadWriteEnabledDescriptor.Id));
Assert.IsNull(textureDiagnostic);
}
@@ -304,7 +304,7 @@ public void Texture_StreamingMipmapDisabled_IsReported()
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TextureStreamingMipmapDisabled, IssueCategory.AssetDiagnostic)
.FirstOrDefault(i =>
- i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.id));
+ i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.Id));
Assert.NotNull(textureDiagnostic);
var descriptor = textureDiagnostic.Id.GetDescriptor();
@@ -316,7 +316,7 @@ public void Texture_StreamingMipmapDisabled_IsReported()
textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TextureStreamingMipmapDisabled, IssueCategory.AssetDiagnostic)
.FirstOrDefault(i =>
- i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.id));
+ i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.Id));
Assert.Null(textureDiagnostic);
}
@@ -327,7 +327,7 @@ public void Texture_StreamingMipmapEnabled_IsNotReported()
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TextureStreamingMipmapEnabled, IssueCategory.AssetDiagnostic)
.FirstOrDefault(i =>
- i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.id));
+ i.Id.Equals(TextureAnalyzer.k_TextureStreamingMipMapEnabledDescriptor.Id));
Assert.IsNull(textureDiagnostic);
}
@@ -341,7 +341,7 @@ public void Texture_AnisotropicLevel_IsReported()
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureAnisotropicLevelBig, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.Id));
Assert.NotNull(textureDiagnostic);
var descriptor = textureDiagnostic.Id.GetDescriptor();
@@ -352,7 +352,7 @@ public void Texture_AnisotropicLevel_IsReported()
textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureAnisotropicLevelBig, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.Id));
Assert.Null(textureDiagnostic);
@@ -364,7 +364,7 @@ public void Texture_AnisotropicLevel_IsNotReported()
{
var textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureAnisotropicLevelOne, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.Id));
Assert.IsNull(textureDiagnostic);
@@ -376,7 +376,7 @@ public void Texture_AnisotropicLevel_IsNotReported()
textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureAnisotropicLevelOne, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.Id));
Assert.IsNull(textureDiagnostic);
textureImporter.mipmapEnabled = true;
@@ -385,7 +385,7 @@ public void Texture_AnisotropicLevel_IsNotReported()
textureDiagnostic =
AnalyzeAndFindAssetIssues(m_TestTextureAnisotropicLevelOne, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureAnalyzer.k_TextureAnisotropicLevelDescriptor.Id));
Assert.IsNull(textureDiagnostic);
textureImporter.anisoLevel = 1;
@@ -397,7 +397,7 @@ public void Texture_AnisotropicLevel_IsNotReported()
public void Texture_SolidTexture_IsReported()
{
var textureDiagnostic = AnalyzeAndFindAssetIssues(m_TextureSolidColor, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureSolidColorDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureSolidColorDescriptor.Id));
Assert.IsNotNull(textureDiagnostic);
}
@@ -406,7 +406,7 @@ public void Texture_SolidTexture_IsReported()
public void Texture_Not_SolidTexture_IsNotReported()
{
var textureDiagnostic = AnalyzeAndFindAssetIssues(m_TextureNotSolidColor, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureSolidColorDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureSolidColorDescriptor.Id));
Assert.IsNull(textureDiagnostic);
}
@@ -415,7 +415,7 @@ public void Texture_Not_SolidTexture_IsNotReported()
public void Texture_EmptySpace_IsReported()
{
var textureDiagnostic = AnalyzeAndFindAssetIssues(m_TestTextureEmptySpace, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureAtlasEmptyDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureAtlasEmptyDescriptor.Id));
Assert.IsNotNull(textureDiagnostic);
}
@@ -425,7 +425,7 @@ public void Texture_EmptySpace_IsNotReported()
{
//We don't need to create a new texture as we only need a not empty one
var textureDiagnostic = AnalyzeAndFindAssetIssues(m_TextureSolidColor, IssueCategory.AssetDiagnostic)
- .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureAtlasEmptyDescriptor.id));
+ .FirstOrDefault(i => i.Id.Equals(TextureUtilizationAnalyzer.k_TextureAtlasEmptyDescriptor.Id));
Assert.IsNull(textureDiagnostic);
}
diff --git a/Tests/Editor/UnexpectedCompilerMessageTests.cs b/Tests/Editor/UnexpectedCompilerMessageTests.cs
index 7a3a32b8d9..6b75cad3b0 100644
--- a/Tests/Editor/UnexpectedCompilerMessageTests.cs
+++ b/Tests/Editor/UnexpectedCompilerMessageTests.cs
@@ -117,11 +117,11 @@ public void UnexpectedCompilerMessage_Issue_IsReported()
var descriptor = myIssue.Id.GetDescriptor();
Assert.NotNull(descriptor);
- Assert.AreEqual(Severity.Moderate, descriptor.defaultSeverity);
+ Assert.AreEqual(Severity.Moderate, descriptor.DefaultSeverity);
Assert.AreEqual(typeof(DescriptorID), myIssue.Id.GetType());
Assert.AreEqual("PAC0066", myIssue.Id.ToString());
- Assert.AreEqual("UnityEngine.Camera", descriptor.type);
- Assert.AreEqual("allCameras", descriptor.method);
+ Assert.AreEqual("UnityEngine.Camera", descriptor.Type);
+ Assert.AreEqual("allCameras", descriptor.Method);
Assert.AreEqual(m_ScriptWithDiagnostic.fileName, myIssue.Filename);
Assert.AreEqual("'UnityEngine.Camera.allCameras' usage", myIssue.Description);