void Awake()
 {
     /*
      * Store a global pointer to this instance rather than using
      * GameObject methods to look it up whenever we need it, as Unity
      * docs recommend against doing this for performance reasons.
      */
     m_instance = this;
 }
Exemple #2
0
        public MapGenTileExporter(MapGenManager manager)
        {
            m_manager = manager;

            if (m_manager.EnableExport)
            {
                /* Delete any existing exported assets, create new folder. */
                AssetDatabase.DeleteAsset(ExportPath);
                AssetDatabase.CreateFolder(ExportParent, ExportDir);
                AssetDatabase.CreateFolder(ExportPath, "Meshes");
            }

            /* Create the container object. */
            m_containerObject = new GameObject("Map");
            MapProperties properties = m_containerObject.AddComponent <MapProperties>();

            properties.CentreLatitude    = m_manager.CentreLatitude;
            properties.CentreLongitude   = m_manager.CentreLongitude;
            properties.TileSize          = m_manager.TileSize;
            properties.WorldSize         = m_manager.WorldSize;
            properties.DetailedWorldSize = m_manager.DetailedWorldSize;
        }
 void OnApplicationQuit()
 {
     m_instance = null;
 }