Coding Help ?!?

Hello, I opened a project and theres code that’s throwing the following errors:

Unexpected symbol “>” “<”

And here is the code snippet :

     [DebuggerHidden]
    private IEnumerator Start()
    {
        WorldBuilder.< Start > c__Iterator2 < Start > c__Iterator = new WorldBuilder.< Start > c__Iterator2();

        < Start > c__Iterator.<> f__this = this;
        return < Start > c__Iterator;

    }

These are the libraries that I have included:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;

Does anybody know why this is incorrect? Any help would be greatly appreciated!! Thank you!

Have you ever used C# before?
Where have you taken the code from? :stuck_out_tongue:

No idea what you are trying to write, but all those < and > don’t make sense…

Yes, I use C# and Javascript(Unityscript)

I got the code from an example project, this is the only script giving me problems.
Here’s the entire script :

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using UnityEngine;


public class WorldBuilder : MonoBehaviour
{

    [DebuggerHidden]
    private IEnumerator Start()
    {
        WorldBuilder.<Start>c__Iterator2 <Start>c__Iterator = new WorldBuilder.<Start>c__Iterator2();
        <Start>c__Iterator.<>f__this = this;
        return <Start>c__Iterator;
    }

 
    [DebuggerHidden]
    private IEnumerator BackgroundBuilding()
    {
        WorldBuilder.<BackgroundBuilding>c__Iterator3 <BackgroundBuilding>c__Iterator = new WorldBuilder.<BackgroundBuilding>c__Iterator3();
        <BackgroundBuilding>c__Iterator.<>f__this = this;
        return <BackgroundBuilding>c__Iterator;
    }


    private static Vector3i GetCurrentChunkPos()
    {
        Vector3i result = Vector3i.Round(Camera.main.transform.position).Div(Chunk.SIZE);
        result.y = 0;
        return result;
    }


    private void GetClosestUnbuiltColumns(Vector3i pos, Queue<ChunkPosition> columns)
    {
        columns.Clear();
        for (int i = 0; i <= 2; i++)
        {
            for (int j = 0; j <= 2; j++)
            {
                Vector2 vector = new Vector2((float)j, (float)i);
                if (vector.sqrMagnitude <= 2f)
                {
                    ChunkPosition item = new ChunkPosition(pos.x + j, 0, pos.z + i);
                    if (item.Check() && !this.chunks2d[(int)item.x, (int)item.z])
                    {
                        columns.Enqueue(item);
                    }
                    item = new ChunkPosition(pos.x - j, 0, pos.z + i);
                    if (item.Check() && !this.chunks2d[(int)item.x, (int)item.z])
                    {
                        columns.Enqueue(item);
                    }
                    item = new ChunkPosition(pos.x + j, 0, pos.z - i);
                    if (item.Check() && !this.chunks2d[(int)item.x, (int)item.z])
                    {
                        columns.Enqueue(item);
                    }
                    item = new ChunkPosition(pos.x - j, 0, pos.z - i);
                    if (item.Check() && !this.chunks2d[(int)item.x, (int)item.z])
                    {
                        columns.Enqueue(item);
                    }
                }
            }
        }
    }

 
    [DebuggerHidden]
    private IEnumerator BackgroundBuildColumn(int x, int z)
    {
        WorldBuilder.<BackgroundBuildColumn>c__Iterator4 <BackgroundBuildColumn>c__Iterator = new WorldBuilder.<BackgroundBuildColumn>c__Iterator4();
        <BackgroundBuildColumn>c__Iterator.x = x;
        <BackgroundBuildColumn>c__Iterator.z = z;
        <BackgroundBuildColumn>c__Iterator.<$>x = x;
        <BackgroundBuildColumn>c__Iterator.<$>z = z;
        <BackgroundBuildColumn>c__Iterator.<>f__this = this;
        return <BackgroundBuildColumn>c__Iterator;
    }


    [DebuggerHidden]
    private IEnumerator BackgroundBuildChunk(Chunk chunk)
    {
        WorldBuilder.<BackgroundBuildChunk>c__Iterator5 <BackgroundBuildChunk>c__Iterator = new WorldBuilder.<BackgroundBuildChunk>c__Iterator5();
        <BackgroundBuildChunk>c__Iterator.chunk = chunk;
        <BackgroundBuildChunk>c__Iterator.<$>chunk = chunk;
        <BackgroundBuildChunk>c__Iterator.<>f__this = this;
        return <BackgroundBuildChunk>c__Iterator;
    }

 
    private const int RADIUS = 2;

 
    public bool runtime = true;


    private readonly bool[,] chunks2d = new bool[32, 32];


    private readonly Queue<ChunkPosition> columns = new Queue<ChunkPosition>();


    private readonly ChunkMeshBuilder builder = new ChunkMeshBuilder();
}

Looks like poorly decompiled code to me.

Btw, this did come from Unity 4.6, do you think "<>"could be removed or replaced in any way? Or any new changes in Unity 5 ?

It’s surely not an example project. Looks like it’s either a de-assembled .dll or project.

Should I trash it? It’s been here a while

Nope, the unity version doesn’t change that those little bits shouldn’t be there.

What’s the best resolution? Change the code? Trash it? Im clueless

That’s your decision.
It’s code that has been taken from a decompiled assembly, or even a whole project. Probably something you shouldn’t use either way.

Does that mean it’s encrypted?
Oh ok thank you, that’s just what i need ed to know! (:

No, that doesn’t mean it is or was encrypted.

Compiled C# code ends up being IL code, the Intermediate Language. You can reverse the whole process. One reason why this code often does not run out of the box is, that during the orignal compilation, code has been optimized, some parts have been generated and even some anonymous data types and such have been created.

I’m no expert on this though. You can find detailed information about it on the internet if you’re interested.