November 2018
Beginner
246 pages
5h 23m
English
A GridManager class handles the 2D grid representation for the world map. We keep it as a singleton instance of the GridManager class, as we only need one object to represent the map. A singleton is a programming pattern that restricts the instantiation of a class to one object and, therefore, it makes the instance easily accessible from any point of the application. The steps to set up the GridManager are as follows:
using UnityEngine; using System.Collections; public class GridManager : MonoBehaviour { private static GridManager s_Instance = null; public static GridManager instance { get { if (s_Instance == null) { s_Instance ...Read now
Unlock full access