Unity, as a tool to develop multi-platform applications

Introduction

Unity, initially released as a game engine development software back in 2005 exclusively for Mac OS-X. It was popular and famous for creating games, but over the recent years, Unity has delivered other possibilities in other areas , such as web, VR and mobile development. In this blog post, Ill be discussing what Unity can do in terms of deploying multi-platform applications.

Overview

Unity is a cross-platform game engine launched in 2005 to build 2D and 3D games. Unity as an IDE, not only allows user to edit and script the game, but also allows the user to play while making the game, meaning that you can test and adjust the specs of the games from the players perspective. Another key feature about Unity, is that Unity supports cross-platform development, including nearly all mainstream platforms like Mobile, Console, Desktop PC, Web, and so much more.  Some successful cross platform application that is developed in Unity include games like HearthStone, Monument valley and Temple run.

What do you need?

Unity license personal account for free and it could be downloaded at unity3d.com . Latest version is recommended but if you are looking for staying on a stable version for an extended period, you could also download historical versions at unity3d.com/get-unity/download/archive .

Supporting libraries could be downloaded along with Unity package, including iOS, android, PC, Mac, and Web supporting packages.  This packages will help the user to successfully deploy their apps to their desired platform. External supporting software like OpenVR will enable VR features.

How to Unity?

This is a standard view with all the essential tools.  PS: The flowing instructions are screenshot for 3D build environment, 2D build is also similar to this, but with 2D plane View.

 

 

 

 

 

 

 

 

 

 

Unity consists a standard 3D view that ensembles the complete 3D environment, including all the Object, lighting, camera, and terrain.

The 3D view, is called Scene in unity. Users are able to rotate, zoom, and shift to see the environment.

Hierarchy shows what is inside the Scene.  A scene, by default, consist a main camera and a directional light, a cube is added for DEMO purposes.

Game displays what the main camera is seeing.

Project window shows what is inside the project directory. Scenes and Objects are all referred as Assets, and they are being stored within the project folder as Unity Assets.

Inspector, handles the detail aspect of Assets, including the settings for Scenes and Objects.

 

 

 

 

 

 

 

 

 

 

 

Inspector  is the manager for components of an object, from backend to frontend. It is super powerful in terms of manipulating an object. Basic manipulation, or Component are included by default such as transform(position, rotation and size), mesh(refers to the 3D shape), mesh renderer(whether if the object is been rendered at play, implies that if the object is visible or not), and collider(detect if the object is in contact with other object).

Other Component could be added by design. An object could be associated with audio clip, particle effect, customized mesh, rigid-body and customized Script written in C# or JS.

Unity allows users to run C# Script on the gaming Object. You can attach script simply by dragging the script from Project window on to the Object in the scene. I’ll be doing a quick demo to show how you can rotate an object using C# script.

C#  is a programming language designed by Microsoft in 2000 and is it very similar to Java, since they are both strong typing, object oriented language. A Unity generated C# Script consist its class name and two methods. Start(), which will run before play, Update(), which will run once per frame.

 

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

public class rotate : MonoBehaviour {

    // Use this for initialization
    void Start () {
        
    }
    
    // Update is called once per frame
    void Update () {
        
    }
}

 

In this case, if i want my cube to rotate constantly, I would want to update its transformation frame by frame. Thus, I’ll code for Update().

    void Update () {
        transform.Rotate(new Vector3(15, 30, 45) * Time.deltaTime);
    }

 

 

 

 

 

 

 

 

 

Now my square is rotating!!!!

If you are willing to learn more about Unity in depth, I recommend unity3d.com/learn for official tutorial and documentations.

Another cool feature about Unity is that is has a built in Assets Store. As previously discussed, assets include scene and object, they are the major component of Unity applications. Some programmers and artists publish their prewritten Assets in the Assets Store, that allows Unity users to work with pre-written component. It is using external libraries in coding.

Assets Store 

For example, I want to work with VR. So, I found a utility toolkit for developing for developing VR experiences in Unity, VIVE Input Utility. This is assets provide official scripts from HTC, including basic input such as pick, grab, throw and teleport.

All of the assets downloaded from the assets store is imported into project folder and are able to be applied in the project.

 

Collaboration

Unity project supports build in collaboration supports, via unity’s own cloud service.

Unity project is also git friendly, that the complete project could be pushed to a git repo and enables collaboration. GitHub for Unity is also a easy to use plugin that enables fluid Unity-GitHub workflow.

Deployment

Deploying apps is super simple in Unity. Unity support nearly all main steam platforms, including Mobile, VR/AR, Desktop, Console and Web.

By correctly configuring the user input for different platforms, one unity script could be build and run on all these platforms.

Cross-platform IDE is giving developers an advantage, that the developers doesn’t need to build their apps using separate tools. Saved a lot of time and resources.

 

Conclusion

In this blog post, I covered a basic run through of Unity, including the major features, Scene, Hierarchy, Game, Inspector, Assets, and C# Scripts ;  as well as how to use external libraries, or call it Asset Store, and at the end, showed how to build the apps that is made in Unity.  Unity is indeed a super powerful and versatile tool that enables developers to be productive and creative at the same time. Unity has delivered a lot of possibilities in gaming industries, but it also shows potentials in other fields.