Skip to content

Unity

Unity is a game engine which can be used to create video games and real-time interactive scenes with 3D graphics. Unity has cross-platform support for Windows, Mac and Linux. It can also be used to create applications for mobile devices running iOS and Android. It is also possible to use Unity to develop for games consoles like Playstation, Xbox and Nintendo Switch, and a range of mixed reality devices including HTC Vive, Oculus and HoloLens2. Unity can be programmed using C# but users also have access to a more user-friendly visual scripting plugin.

Personal Experience

Unity was the first game engine I learnt to use and I have been working with it continuously since around 2010. It benefits from a large indie developer community, good documentation, and is free to download and use for non-commercial projects. I have worked with Unity on several notable projects including visualisations I programmed for ViLo at the Centre for Advanced Spatial Analysis (CASA), and my research into Digital Twin technologies for which I used it to create the front-end and web-based interfaces for the Here East Digital Twin.

Tools & Software Integrations

N/A

Unity includes a Package Manager which provides access to a range of additional functionality from within the Unity Editor. The Unity Asset Store also provides a range of free and paid content, assets and plugins created by the wider developer community.

  • Cesium for Unity by Cesium. This plugin enables visualisation in Unity using a full-scale, high-accuracy virtual globe using the WGS84 coordinate reference system. Unity game objects can be georeferenced and global geographic content including terrain, imagery, 3D buildings, and photogrammetry can be integrated, primarily via the Cesium Ion cloud-based content management system. Documentation and user guides are available here.

Resources

N/A

Notes and Troubleshooting

Enable Source Control with GitHub in Unity

  1. Ensure you have downloaded and configured GitHub, GitLFS and GitHub Desktop. You will also need a GitHub account.
  2. Open Unity Hub.
  3. Create a new Unity project by clicking 'New Project':
    • Select the latest required Editor version.
    • Select the preferred template e.g. 3D (URP).
    • Provide a project name.
    • Specify the file path to the preferred location for the project.
    • Click 'Create Project'.
  4. Open GitHub Desktop on your computer.
  5. Add the new repository to version control by selecting File > Add local repository:
    • Select the file path to the new Unity project folder:
    • Click the link 'create a repository'.
    • Add a description for the project.
    • Check the box to initialise the project with a README file.
    • Add a Git Ignore file using the 'Unity' template.
    • Add a software license as required.
    • Click 'Create Repository'.
    • Click 'Initialize Git LFS'.
    • NOTE: You may need to reselect the path and click 'Create Repository' again after initialising Git LFS.
  6. Specify binary file types for Git LFS to track:
    • Open a command prompt in the new project location by selecting Repository > Open in Command Prompt.
    • Add files to be tracked git lfs track "*.obj".
    • Ensure the resulting .gitattributes file is tracked git add .gitattributes.
    • The .gitattributes file can be overwritten with a template such as the following if required: https://gist.github.com/Srfigie/77b5c15bc5eb61733a74d34d10b3ed87
  7. Back in GitHub Desktop click 'Publish Repository'.
  8. Ensure the check box 'Keep this code private' is ticked if you want your code to be private.
  9. Click 'Publish Repository'.
  10. Log into GitHub to check the repository has been created.
    1. You can now commit changes from within Unity and then push changes to the remote repository on GitHub from GitHub Desktop.

Source: https://youtu.be/09McJ2NL7YM