public static void Instantiate() { _Instance = new World(); MainLoop.GetInstance().RegisterLoopes(_Instance); System.Random r = new System.Random(); PlayerPos = new Int3(r.Next(-1000, 1000), 120, r.Next(-1000, 1000)); PP = Int3.ToVector3(PlayerPos); if (Serializer.CheckFileExists(FileManager.GetPlayerSaveFileName(1))) { PlayerSettings.PrepareGame(Serializer.Deserialize_From_File <float[]>(FileManager.GetPlayerSaveFileName(1))); } if (Serializer.CheckFileExists(FileManager.GetPlayerSaveFileName(2))) { PlayerSettings.PrepareGame(Serializer.Deserialize_From_File <int[]>(FileManager.GetPlayerSaveFileName(2))); PP = PlayerSettings.Position; PlayerPos = new Int3(PP); } if (Serializer.CheckFileExists(FileManager.GetSaveDirectory() + "game.dat")) { int[] tmpData = Serializer.Deserialize_From_File <int[]>(FileManager.GetSaveDirectory() + "game.dat"); GameTime.Initialize((float)tmpData[0], tmpData[1]); } else { GameTime.Initialize(); } }
public void LoadAsset(AssetLoadRequestTO to) { expected += 1; loaded += 0; startDate = DateTime.Now; MainLoop main = MainLoop.GetInstance(); main.StartCoroutine(LoadAsync(to)); }
void Start() { StateOfTheGame = GameState.LOADING; _Instance = this; FileManager.RegisterFiles(); TextureAtlas._Instance.CreateAtlas(); MainLoop.Instantiate(); MainL = MainLoop.GetInstance(); Cursor.visible = false; MainL.Start(); StateOfTheGame = GameState.RUNNING; EventHandler.RegisterEvent(GameManager._Instance.HandleESCKey, KeyCode.Escape); DayNightCycle.DNCycle.cycleEnabled = true; }
/// <summary> /// Loads up a list of assets /// </summary> public void LoadAssets(List <AssetLoadRequestTO> assetLoadRequestList) { Debug.Log("Preparing to Load " + assetLoadRequestList.Count + " assets."); startDate = DateTime.Now; expected += assetLoadRequestList.Count; MainLoop main = MainLoop.GetInstance(); for (int i = 0, count = assetLoadRequestList.Count; i < count; i++) { AssetLoadRequestTO to = assetLoadRequestList[i]; if (to.assetLoadType == AssetLoadType.SpriteSheet) { LoadAllObjectsInPath(to); } else { main.StartCoroutine(LoadAsync(to)); } } }
public static void Instantiate() { MainLoop.GetInstance().RegisterLoopes(_Instance); PlayerGUI.Inventory(); }
public static void Instantiate() { MainLoop.GetInstance().RegisterLoopes(MainLog); }