I’m early in my career of becoming fluent in C# explicitly for use within the Unity Game Engine. I want to thank Brian (VegetarianZombie on YouTube) for creating a friendly, bite sized, and thorough curriculum which makes C# truly easy to grasp and understand.

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

public enum myList
{
    James, Earl, Jones
}

public class EnumeratedSwitchSolidified : MonoBehaviour
{

    public myList ChosenEntry;

    void OnDisable()
    {
        switch (ChosenEntry)
        {
            case myList.James:
                Debug.Log("This is " + myList.James);
                break;
            case myList.Earl:
                Debug.Log("This is " + myList.Earl);
                break;
            case myList.Jones:
                Debug.Log("This is " + myList.Jones);
                break;
        }
    }
}
, ,

Leave a Reply

Your email address will not be published. Required fields are marked *