Namespaces

Script name conflicts become more likely as the number of scripts increases.
C# provides a feature called Namespace. It's a reliable way to solve this problem. Namespace is a collection of classes. When referencing a class within the collection, you need to use the chosen prefix in the class name. Please refer to the Microsoft document about Namespace for more details.

In a Lua script:

  • Using Unity-related classes requires a namespace to be written in full. For example, UnityEngine.GameObject, UnityEngine.Transform, UnityEngine.UI.Text;
  • When using the classes provided by ParaSpace, you only need to write the class name, for example, ParaPlayerService, ParaPlayer.