That will work but it’s completely unnecessary. You can remove using System.Diagnostics;
completely. It just confuses things and we never use it. Once you’ve done that there is no need for using Debug = UnityEngine.Debug;
(you can just change it back to using UnityEngine;
) and everything will work the way it does in the course.
Here’s what’s happening: Both System.Diagnostics
and UnityEngine
has a type called Debug
. When you have both in the using
section, the compiler does not know which of these types you want to use. The recommendation is to ‘alias’ the UnityEngine.Debug
to just be Debug
so the compiler will know which one to use (because it uses the alias) but in 99% of games we never need System.Diagnostics
so it does not need to be in the using
list at all.
You will find the same problem when you start using Random
because System
and UnityEngine
also both have a type called Random
and when you need to use stuff from System
(like Serializable
) and you want to also get random values from UnityEngine.Random
you will find the same error happening. In this case I personally alias Random
(using Random = UnityEngine.Random;
) but you could just qualify the types you want to use, like System.Serializable
instead of just Serializable
and then not have the using System;
in the using
section.