Exemplo n.º 1
0
    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();
        }
    }
Exemplo n.º 2
0
        public void LoadAsset(AssetLoadRequestTO to)
        {
            expected += 1;
            loaded   += 0;

            startDate = DateTime.Now;

            MainLoop main = MainLoop.GetInstance();

            main.StartCoroutine(LoadAsync(to));
        }
Exemplo n.º 3
0
    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;
    }
Exemplo n.º 4
0
        /// <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));
                }
            }
        }
Exemplo n.º 5
0
 public static void Instantiate()
 {
     MainLoop.GetInstance().RegisterLoopes(_Instance);
     PlayerGUI.Inventory();
 }
Exemplo n.º 6
0
 public static void Instantiate()
 {
     MainLoop.GetInstance().RegisterLoopes(MainLog);
 }