0

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);
    }

}

}

  • 1
    I've removed the `[unityscript]` tag because this code is clearly written in the C# programming language and not the Unityscript programming language. – ProgrammingLlama Jan 25 '21 at 08:32
  • I don't see such any tag in my script so what should I do? – Shahariar Kabir Jan 25 '21 at 08:38
  • 1
    You had added the tag to your question (see [this screenshot](https://i.stack.imgur.com/cYr9s.png)). I removed it for you because your code is C#. My comment wasn't related to your code. – ProgrammingLlama Jan 25 '21 at 08:39
  • Is the package up-to-date? Check it in the [PackageManager](https://docs.unity3d.com/Manual/upm-ui.html) .. downgrading is never a good idea ... always make backups and even better use some version controlling (git e.g.) – derHugo Jan 25 '21 at 14:19
  • Yes, first it wasn't then I upgraded but the problem didn't solved – Shahariar Kabir Jan 25 '21 at 14:20

0 Answers0