public void Start()
    {
        Application.RegisterLogCallback(HandleLog);

        MeshUtils.InitStaticValues();
        CubeWorldPlayerPreferences.LoadPreferences();
        PreferencesUpdated();

        State = state = GameManagerUnityState.MAIN_MENU;
        mainMenu = new MainMenu(this);

		sectorManagerUnity = new SectorManagerUnity(this);
		objectsManagerUnity = new CWObjectsManagerUnity(this);
        fxManagerUnity = new CWFxManagerUnity(this);

        worldManagerUnity = new WorldManagerUnity(this);
	}
Example #2
0
    public void Start()
    {
        Application.RegisterLogCallback(HandleLog);

        MeshUtils.InitStaticValues();
        CubeWorldPlayerPreferences.LoadPreferences();
        PreferencesUpdated();

        State    = state = GameManagerUnityState.MAIN_MENU;
        mainMenu = new MainMenu(this);

        sectorManagerUnity  = new SectorManagerUnity(this);
        objectsManagerUnity = new CWObjectsManagerUnity(this);
        fxManagerUnity      = new CWFxManagerUnity(this);

        worldManagerUnity = new WorldManagerUnity(this);
    }
Example #3
0
    public void Update()
    {
        if (registerInWebServer)
        {
            RegisterInWebServer();
        }

        switch (state)
        {
        case GameManagerUnityState.GENERATING:
        {
            if (worldManagerUnity.worldGeneratorProcess != null && worldManagerUnity.worldGeneratorProcess.IsFinished() == false)
            {
                worldManagerUnity.worldGeneratorProcess.Generate();
            }
            else
            {
                worldManagerUnity.worldGeneratorProcess = null;

                PreferencesUpdated();

                StartGame();
            }

            break;
        }

        case GameManagerUnityState.PAUSE:
        case GameManagerUnityState.GAME:
        {
            if (world != null)
            {
                surroundingsUnity.UpdateSkyColor();
                playerUnity.UpdateControlled();
                world.Update(Time.deltaTime);
                UpdateAnimatedTexture();
            }
            break;
        }
        }

        if (newState != state)
        {
            state = newState;
        }
    }
Example #4
0
    public void Unpause()
    {
        LockCursor();

        State = GameManagerUnityState.GAME;
    }
Example #5
0
    public void Pause()
    {
        ReleaseCursor();

        State = GameManagerUnityState.PAUSE;
    }
    public void Update()
    {
#if !UNITY_WEBPLAYER
        if (registerInWebServer)
            RegisterInWebServer();
#endif

        switch (state)
        {
            case GameManagerUnityState.GENERATING:
            {
                if (worldManagerUnity.worldGeneratorProcess != null && worldManagerUnity.worldGeneratorProcess.IsFinished() == false)
                {
                    worldManagerUnity.worldGeneratorProcess.Generate();
                }
                else
                {
                    worldManagerUnity.worldGeneratorProcess = null;
				
                    PreferencesUpdated();

                    StartGame();
                }

                break;
            }

            case GameManagerUnityState.PAUSE:
            case GameManagerUnityState.GAME:
            {
                if (world != null)
                {
                    surroundingsUnity.UpdateSkyColor();
                    playerUnity.UpdateControlled();
                    world.Update(Time.deltaTime);
                    UpdateAnimatedTexture();
                }
                break;
            }
        }

        if (newState != state)
            state = newState;
    }
    public void ReturnToMainMenu()
    {
        DestroyWorld();

        camera.enabled = true;

        State = GameManagerUnityState.MAIN_MENU;
    }
    public void Unpause()
    {
        LockCursor();

        State = GameManagerUnityState.GAME;
    }
    public void Pause()
    {
        ReleaseCursor();

        State = GameManagerUnityState.PAUSE;
    }
Example #10
0
    public void StartGame()
    {
        camera.enabled = false;

        LockCursor();

        State = GameManagerUnityState.GAME;
    }