When I completed my whole game and then went to build it in the build settings, I came up with some of the errors which are general build errors and two errors of a script I haven't touch anywhere in my whole career. The script is a UI script that I didn't even touch or change in my whole game making process. And I also didn't found this error while I was working on the game or UI system. It suddenly pops up and now not letting me run the game.
Errors:
G:\Unity\2020.2.1f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\VertexModifiers\Outline.cs(14,30): error CS0115: 'Outline.ModifyMesh(VertexHelper)': no suitable method found to override
and
G:\Unity\2020.2.1f1\Editor\Data\Resources\PackageManager\BuiltInPackages\com.unity.ugui\Runtime\UI\Core\VertexModifiers\Outline.cs(9,28): error CS0246: The type or namespace name 'Shadow' could not be found (are you missing a using directive or an assembly reference?)
I have tried my best to find a solution and for the last few days I have been trying many things to solve it but I came up with nothing. But one thing to note I didn't found this error when I tried to fix it by downgrading my project to Unity 2019.4.18f1 but there I came up with some new errors which seems more complicated to me. Now I am asking for help here kind of being helpless after researching last week. Now I am also thinking of doing the project from scratch again. If you can help me then please because now only your help can save me from doing it from scratch for the next few weeks.
using System.Collections.Generic;
namespace UnityEngine.UI
{
[AddComponentMenu("UI/Effects/Outline", 15)]
/// <summary>
/// Adds an outline to a graphic using IVertexModifier.
/// </summary>
public class Outline : Shadow
{
protected Outline()
{ }
public override void ModifyMesh(VertexHelper vh)
{
if (!IsActive())
return;
var verts = ListPool<UIVertex>.Get();
vh.GetUIVertexStream(verts);
var neededCpacity = verts.Count * 5;
if (verts.Capacity < neededCpacity)
verts.Capacity = neededCpacity;
var start = 0;
var end = verts.Count;
ApplyShadowZeroAlloc(verts, effectColor, start, verts.Count, effectDistance.x, effectDistance.y);
start = end;
end = verts.Count;
ApplyShadowZeroAlloc(verts, effectColor, start, verts.Count, effectDistance.x, -effectDistance.y);
start = end;
end = verts.Count;
ApplyShadowZeroAlloc(verts, effectColor, start, verts.Count, -effectDistance.x, effectDistance.y);
start = end;
end = verts.Count;
ApplyShadowZeroAlloc(verts, effectColor, start, verts.Count, -effectDistance.x, -effectDistance.y);
vh.Clear();
vh.AddUIVertexTriangleStream(verts);
ListPool<UIVertex>.Release(verts);
}
}
}