Problems with Creator Kit: Beginner Code

I was just following the tutorial when it suddenly said there are 21 errors. All these errors had nothing to do with the code I was editing (I think) based on the tutorial. According to Visual Studio, there are no issues found. I have tried everything from my limited knowledge, including undoing everything, clearing the errors and restoring the code from before. When I double-click the error, it doesn’t show me where the error has occured in the code. The problems came from 6 different codes:

The code from "BaseElementalEffects.cs":

using System;
using System.Collections;
using System.Collections.Generic;
using CreatorKitCode;
using TMPro;
using UnityEngine;
namespace CreatorKitCode
{
    /// <summary>
    /// The base class to derive from to write you own custom Elemental effect that can be added to a StatsSystem. There
    /// is a default implementation called ElementalEffect that can be used to make Physical/Fire/Electrical/Cold damage
    /// across time.
    ///
    /// A derived class *must* implement the Equals function so we can check if 2 effects are the same (e.g. the default
    /// implementation ElementalEffect will consider 2 effect equal if they do the same DamageType).
    /// </summary>
    public abstract class BaseElementalEffect : IEquatable<BaseElementalEffect>
    {
        public bool Done => m_Timer <= 0.0f;
        public float CurrentTime => m_Timer;
        public float Duration => m_Duration;
      
        protected float m_Duration;
        protected float m_Timer;
        protected CharacterData m_Target;
        public BaseElementalEffect(float duration)
        {
            m_Duration = duration;
        }
        public virtual void Applied(CharacterData target)
        {
            m_Timer = m_Duration;
            m_Target = target;
        }
        public virtual void Removed()
        {
      
        }
        public virtual void Update(StatSystem statSystem)
        {
            m_Timer -= Time.deltaTime;
        }
        public abstract bool Equals(BaseElementalEffect other);
    }
    /// <summary>
    /// Default implementation of the BaseElementalEffect. The constructor allows the caller to specify what type of
    /// damage is done, how much is done and the speed (time) between each instance of damage (default 1 = every second).
    /// </summary>
    public class ElementalEffect : BaseElementalEffect
    {
        int m_Damage;
        StatSystem.DamageType m_DamageType;
        float m_DamageSpeed;
        float m_SinceLastDamage = 0.0f;
        VFXManager.VFXInstance m_FireInstance;
        public ElementalEffect(float duration, StatSystem.DamageType damageType, int damage, float speed = 1.0f) :
            base(duration)
        {
            m_Damage = damage;
            m_DamageType = damageType;
            m_DamageSpeed = speed;
        }
      
        public override void Update(StatSystem statSystem)
        {
            base.Update(statSystem);
            m_SinceLastDamage += Time.deltaTime;
            if (m_SinceLastDamage > m_DamageSpeed)
            {
                m_SinceLastDamage = 0;
                Weapon.AttackData data = new Weapon.AttackData(m_Target);
                data.AddDamage(m_DamageType, m_Damage);
              
                statSystem.Damage(data);
            }
          
            //we do not parent as if the original object is destroy it would destroy the instance
            m_FireInstance.Effect.transform.position = m_Target.transform.position + Vector3.up;
        }
        public override bool Equals(BaseElementalEffect other)
        {
            ElementalEffect eff = other as ElementalEffect;
            if (other == null)
                return false;
            return eff.m_DamageType == m_DamageType;
        }
        public override void Applied(CharacterData target)
        {
            base.Applied(target);
            //We use the fire effect as it's the only one existing in the project.
            //You can add new VFX and use an if or switch statement to use the right VFXType
            //depending on this effect m_DamageType
            m_FireInstance = VFXManager.GetVFX(VFXType.FireEffect);
            m_FireInstance.Effect.transform.position = target.transform.position + Vector3.up;
        }
        public override void Removed()
        {
            base.Removed();
          
            m_FireInstance.Effect.SetActive(false);
        }
    }
}

The code from "TestResultRendererCallback.cs":

using NUnit.Framework.Interfaces;
namespace UnityEngine.TestTools.TestRunner.Callbacks
{
    internal class TestResultRendererCallback : MonoBehaviour, ITestRunnerListener
    {
        private TestResultRenderer m_ResultRenderer;
        public void RunStarted(ITest testsToRun)
        {
        }
        public void RunFinished(ITestResult testResults)
        {
            if (Camera.main == null)
            {
                gameObject.AddComponent<Camera>();
            }
            m_ResultRenderer = new TestResultRenderer(testResults);
            m_ResultRenderer.ShowResults();
        }
        public void OnGUI()
        {
            if (m_ResultRenderer != null)
                m_ResultRenderer.Draw();
        }
        public void TestStarted(ITest test)
        {
        }
        public void TestFinished(ITestResult result)
        {
        }
    }
}

The code from “PlayModeRunnerCallback.cs”:

using NUnit.Framework;
using NUnit.Framework.Interfaces;
namespace UnityEngine.TestTools.TestRunner.Callbacks
{
    [AddComponentMenu("")]
    internal class PlayModeRunnerCallback : MonoBehaviour, ITestRunnerListener
    {
        private TestResultRenderer m_ResultRenderer;
        public void RunFinished(ITestResult testResults)
        {
            Application.logMessageReceivedThreaded -= LogRecieved;
            if (Camera.main == null)
            {
                gameObject.AddComponent<Camera>();
            }
            m_ResultRenderer = new TestResultRenderer(testResults);
            m_ResultRenderer.ShowResults();
        }
        public void TestFinished(ITestResult result)
        {
        }
        public void OnGUI()
        {
            if (m_ResultRenderer != null)
                m_ResultRenderer.Draw();
        }
        public void RunStarted(ITest testsToRun)
        {
            Application.logMessageReceivedThreaded += LogRecieved;
        }
        public void TestStarted(ITest test)
        {
        }
        private void LogRecieved(string message, string stacktrace, LogType type)
        {
            if (TestContext.Out != null)
                TestContext.Out.WriteLine(message);
        }
    }
}

The code from “PlaymodeTestsController.cs”:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.SceneManagement;
using UnityEngine.TestRunner.NUnitExtensions;
using UnityEngine.TestRunner.NUnitExtensions.Runner;
using UnityEngine.TestTools.NUnitExtensions;
using UnityEngine.TestTools.Utils;
namespace UnityEngine.TestTools.TestRunner
{
    [Serializable]
    [AddComponentMenu("")]
    internal class PlaymodeTestsController : MonoBehaviour
    {
        private IEnumerator m_TestSteps;
        [SerializeField]
        private List<string> m_AssembliesWithTests;
        public List<string> AssembliesWithTests
        {
            get
            {
                return m_AssembliesWithTests;
            }
            set
            {
                m_AssembliesWithTests = value;
            }
        }
        [SerializeField]
        internal TestStartedEvent testStartedEvent = new TestStartedEvent();
        [SerializeField]
        internal TestFinishedEvent testFinishedEvent = new TestFinishedEvent();
        [SerializeField]
        internal RunStartedEvent runStartedEvent = new RunStartedEvent();
        [SerializeField]
        internal RunFinishedEvent runFinishedEvent = new RunFinishedEvent();
        internal const string kPlaymodeTestControllerName = "Code-based tests runner";
        [SerializeField]
        public PlaymodeTestsControllerSettings settings = new PlaymodeTestsControllerSettings();
        internal UnityTestAssemblyRunner m_Runner;
        public IEnumerator Start()
        {
            //Skip 2 frame because Unity.
            yield return null;
            yield return null;
            StartCoroutine(Run());
        }
        internal static bool IsControllerOnScene()
        {
            return GameObject.Find(kPlaymodeTestControllerName) != null;
        }
        internal static PlaymodeTestsController GetController()
        {
            return GameObject.Find(kPlaymodeTestControllerName).GetComponent<PlaymodeTestsController>();
        }
        public IEnumerator TestRunnerCoroutine()
        {
            while (m_TestSteps.MoveNext())
            {
                yield return m_TestSteps.Current;
            }
            if (m_Runner.IsTestComplete)
            {
                runFinishedEvent.Invoke(m_Runner.Result);
                Cleanup();
                yield return null;
            }
        }
        public IEnumerator Run()
        {
            CoroutineTestWorkItem.monoBehaviourCoroutineRunner = this;
            gameObject.hideFlags |= HideFlags.DontSave;
            if (settings.sceneBased)
            {
                SceneManager.LoadScene(1, LoadSceneMode.Additive);
                yield return null;
            }
            var testListUtil = new PlayerTestAssemblyProvider(new AssemblyLoadProxy(), m_AssembliesWithTests);
            m_Runner = new UnityTestAssemblyRunner(new UnityTestAssemblyBuilder(), new PlaymodeWorkItemFactory());
            var loadedTests = m_Runner.Load(testListUtil.GetUserAssemblies().Select(a => a.Assembly).ToArray(), TestPlatform.PlayMode, UnityTestAssemblyBuilder.GetNUnitTestBuilderSettings(TestPlatform.PlayMode));
            loadedTests.ParseForNameDuplicates();
            runStartedEvent.Invoke(m_Runner.LoadedTest);
            var testListenerWrapper = new TestListenerWrapper(testStartedEvent, testFinishedEvent);
            m_TestSteps = m_Runner.Run(testListenerWrapper, settings.BuildNUnitFilter()).GetEnumerator();
            yield return TestRunnerCoroutine();
        }
        public void Cleanup()
        {
            if (m_Runner != null)
            {
                m_Runner.StopRun();
                m_Runner = null;
            }
            if (Application.isEditor)
            {
                Destroy(gameObject);
            }
        }
        public static void TryCleanup()
        {
            var controller = GetController();
            if (controller != null)
            {
                controller.Cleanup();
            }
        }
    }
}

The code from “RemoteTestResultSender.cs”

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework.Interfaces;
using UnityEngine.Networking.PlayerConnection;
using UnityEngine.TestRunner.TestLaunchers;
namespace UnityEngine.TestTools.TestRunner.Callbacks
{
    [AddComponentMenu("")]
    internal class RemoteTestResultSender : MonoBehaviour, ITestRunnerListener
    {
        private class QueueData
        {
            public Guid id { get; set; }
            public byte[] data { get; set; }
        }
        private const int k_aliveMessageFrequency = 120;
        private float m_NextliveMessage = k_aliveMessageFrequency;
        private readonly Queue<QueueData> m_SendQueue = new Queue<QueueData>();
        private readonly object m_LockQueue = new object();
        private readonly IRemoteTestResultDataFactory m_TestResultDataFactory = new RemoteTestResultDataFactory();
        public void Start()
        {
            StartCoroutine(SendDataRoutine());
        }
        private byte[] SerializeObject(object objectToSerialize)
        {
            return Encoding.UTF8.GetBytes(JsonUtility.ToJson(objectToSerialize));
        }
        public void RunStarted(ITest testsToRun)
        {
            var data = SerializeObject(m_TestResultDataFactory.CreateFromTest(testsToRun));
            lock (m_LockQueue)
            {
                m_SendQueue.Enqueue(new QueueData
                {
                    id = PlayerConnectionMessageIds.runStartedMessageId,
                    data = data
                });
            }
        }
        public void RunFinished(ITestResult testResults)
        {
            var data = SerializeObject(m_TestResultDataFactory.CreateFromTestResult(testResults));
            lock (m_LockQueue)
            {
                m_SendQueue.Enqueue(new QueueData { id = PlayerConnectionMessageIds.runFinishedMessageId, data = data, });
            }
        }
        public void TestStarted(ITest test)
        {
            var data = SerializeObject(m_TestResultDataFactory.CreateFromTest(test));
            lock (m_LockQueue)
            {
                m_SendQueue.Enqueue(new QueueData
                {
                    id = PlayerConnectionMessageIds.testStartedMessageId,
                    data = data
                });
            }
        }
        public void TestFinished(ITestResult result)
        {
            var testRunnerResultForApi = m_TestResultDataFactory.CreateFromTestResult(result);
            var resultData = SerializeObject(testRunnerResultForApi);
            lock (m_LockQueue)
            {
                m_SendQueue.Enqueue(new QueueData
                {
                    id = PlayerConnectionMessageIds.testFinishedMessageId,
                    data = resultData,
                });
            }
        }
        public IEnumerator SendDataRoutine()
        {
            while (!PlayerConnection.instance.isConnected)
            {
                yield return new WaitForSeconds(1);
            }
            while (true)
            {
                lock (m_LockQueue)
                {
                    if (PlayerConnection.instance.isConnected && m_SendQueue.Count > 0)
                    {
                        ResetNextPlayerAliveMessageTime();
                        var queueData = m_SendQueue.Dequeue();
                        PlayerConnection.instance.Send(queueData.id, queueData.data);
                        yield return null;
                    }
                    //This is needed so we dont stall the player totally
                    if (!m_SendQueue.Any())
                    {
                        SendAliveMessageIfNeeded();
                        yield return new WaitForSeconds(0.02f);
                    }
                }
            }
        }
        private void SendAliveMessageIfNeeded()
        {
            if (Time.timeSinceLevelLoad < m_NextliveMessage)
            {
                return;
            }
            Debug.Log("Sending player alive message back to editor.");
            ResetNextPlayerAliveMessageTime();
            PlayerConnection.instance.Send(PlayerConnectionMessageIds.playerAliveHeartbeat, new byte[0]);
        }
        private void ResetNextPlayerAliveMessageTime()
        {
            m_NextliveMessage = Time.timeSinceLevelLoad + k_aliveMessageFrequency;
        }
    }
}

The code from “PlayQuitHandler.cs”:

using NUnit.Framework.Interfaces;
using UnityEngine.Networking.PlayerConnection;
using UnityEngine.TestRunner.TestLaunchers;
namespace UnityEngine.TestTools.TestRunner.Callbacks
{
    internal class PlayerQuitHandler : MonoBehaviour, ITestRunnerListener
    {
        public void Start()
        {
            PlayerConnection.instance.Register(PlayerConnectionMessageIds.quitPlayerMessageId, ProcessPlayerQuiteMessage);
        }
        private void ProcessPlayerQuiteMessage(MessageEventArgs arg0)
        {
            //Some platforms don't quit, so we need to disconnect to make sure they will not connect to another editor instance automatically.
            PlayerConnection.instance.DisconnectAll();
            //XBOX has an error when quitting
            if (Application.platform == RuntimePlatform.XboxOne)
            {
                return;
            }
            Application.Quit();
        }
        public void RunStarted(ITest testsToRun)
        {
        }
        public void RunFinished(ITestResult testResults)
        {
        }
        public void TestStarted(ITest test)
        {
        }
        public void TestFinished(ITestResult result)
        {
        }
    }
}

If there is anyone out there who sees the problem and/or who knows what to do, please help me.

I’ll say it again: we cannot read your mind or your computer screen.

What are the errors, what does Google tell you about those errors?

If you still cannot figure it out, COPY/PASTE THE ERROR HERE! Include full text, including line, referenced to the above source code.

In the console window there is a line number and source file. Go there. See what the error is.

If there is no line number, then perhaps it is a Unity internal error.

You can tell this by looking at the stack trace, lower part of the consoel window.