Exemplo n.º 1
0
    void Start()
    {
        EndGameOverlay = GameObject.Find("CanvasEndGame");
        if (EndGameOverlay != null)
        {
            EndGameOverlay.SetActive(false);
        }

        StartGameOverlay = GameObject.Find("CanvasStartGame");
        if (StartGameOverlay != null)
        {
            StartGameOverlay.SetActive(true);
        }

        GamePlayOverlay = GameObject.Find("CanvasGamePlay");
        if (GamePlayOverlay != null)
        {
            GamePlayOverlay.SetActive(false);
        }

        GameBackingOverlay = GameObject.Find("GameBackingLayer");
        if (GameBackingOverlay != null)
        {
            GameBackingOverlay.SetActive(true);
        }

        _playfieldState = ePlayfieldState.waitingToStart;



        if (GamePlayOverlay != null)
        {
            GamePlayOverlay.SetActive(true);
        }

        if (GameplayManager._gameDifficulty == GameplayManager.eGameDifficulty.easy)
        {
            PlayFieldEasy.SetActive(true);
            PlayFieldHard.SetActive(false);
            //PlayFieldExpert.SetActive (false);
        }
        else if (GameplayManager._gameDifficulty == GameplayManager.eGameDifficulty.hard)
        {
            PlayFieldEasy.SetActive(false);
            PlayFieldHard.SetActive(true);
            //PlayFieldExpert.SetActive (false);
        }
        else if (GameplayManager._gameDifficulty == GameplayManager.eGameDifficulty.expert)
        {
            PlayFieldEasy.SetActive(false);
            PlayFieldHard.SetActive(false);
            //PlayFieldExpert.SetActive (true);
        }
    }
Exemplo n.º 2
0
    void Update()
    {
        switch (_playfieldState)
        {
        case ePlayfieldState.init:
            break;

        case ePlayfieldState.waitingToStart:
            SetCircularLoadAmount(1.0f);
            break;

        case ePlayfieldState.gameplay:

            //get timing value from gameplay manager

            //float remainingTime = GameCommon.getGameplayManagerClass ().GetPuzzleTimeLeft ();
            float remainingTime = GameplayManager.Instance.GetPuzzleTimeLeft();

            SetCircularLoadAmount(remainingTime);

            break;

        case ePlayfieldState.displayResults:
        {
            _playfieldState = ePlayfieldState.showingResults;
        }
        break;

        case ePlayfieldState.showingResults:
        {
            _elaspedTime += Time.deltaTime;



            if (_elaspedTime > _puzzleResultsTime)
            {
                //start next puzzle - call gameplay manager
                Debug.Log("_playfieldState : StartNextPuzzle");

                //GameCommon.getGameplayManagerClass().StartNextPuzzle();
                GameplayManager.Instance.StartNextPuzzle();
                _playfieldState = ePlayfieldState.gameplay;

                _elaspedTime = 0.0f;
            }
        }
        break;
        }
    }
Exemplo n.º 3
0
    //GUI
    //this gets called by the GUI button "Ready"
    public void StartMatch()
    {
        //remove canvas
        if (StartGameOverlay != null)
            StartGameOverlay.SetActive(false);

        if (GamePlayOverlay != null)
            GamePlayOverlay.SetActive(true);

        _playfieldState = ePlayfieldState.gameplay;

        GameCommon.getGameplayManagerClass()._gameDifficulty = GameplayManager.eGameDifficulty.hard;

        GameCommon.getGameplayManagerClass().StartGame();
    }
Exemplo n.º 4
0
    //GUI
    //this gets called by the GUI button "Ready"
    public void StartMatch()
    {
        //remove canvas
        if (StartGameOverlay != null)
        {
            StartGameOverlay.SetActive(false);
        }

        if (GamePlayOverlay != null)
        {
            GamePlayOverlay.SetActive(true);
        }

        _playfieldState = ePlayfieldState.gameplay;

        GameplayManager.Instance.StartGame();
    }
Exemplo n.º 5
0
 //only for last puzzle - wait and trigger next puzzle
 public void SetPuzzleResults(int score, int level)
 {
     _playfieldState = ePlayfieldState.displayResults;
     SetOverlayScoreAndLevel(score, level);
 }
Exemplo n.º 6
0
    void Update()
    {
        switch (_playfieldState)
        {
            case ePlayfieldState.init:
                break;

            case ePlayfieldState.waitingToStart:
                SetCircularLoadAmount(1.0f);
                break;

            case ePlayfieldState.gameplay:

                //get timing value from gameplay manager

                float remainingTime = GameCommon.getGameplayManagerClass().GetPuzzleTimeLeft();
                SetCircularLoadAmount(remainingTime);

                break;

            case ePlayfieldState.displayResults:
            {
                _playfieldState = ePlayfieldState.showingResults;

            }
            break;

            case ePlayfieldState.showingResults:
            {
                _elaspedTime += Time.deltaTime;

                if(_elaspedTime > _puzzleResultsTime)
                {
                    //start next puzzle - call gameplay manager
                    Debug.Log ("_playfieldState : StartNextPuzzle");

                    GameCommon.getGameplayManagerClass().StartNextPuzzle();

                    _playfieldState = ePlayfieldState.gameplay;

                    _elaspedTime = 0.0f;
                }
            }
            break;

        }
    }
Exemplo n.º 7
0
    void Start()
    {
        EndGameOverlay = GameObject.Find("CanvasEndGame");
        if (EndGameOverlay != null)
        {
            EndGameOverlay.SetActive(false);
        }

        StartGameOverlay = GameObject.Find("CanvasStartGame");
        if (StartGameOverlay != null)
        {
            StartGameOverlay.SetActive(true);
        }

        GamePlayOverlay = GameObject.Find("CanvasGamePlay");
        if (GamePlayOverlay != null)
        {
            GamePlayOverlay.SetActive(false);
        }

        GameBackingOverlay = GameObject.Find("GameBackingLayer");
        if (GameBackingOverlay != null)
        {
            GameBackingOverlay.SetActive(true);
        }

        _playfieldState = ePlayfieldState.waitingToStart;
    }
Exemplo n.º 8
0
    //only for last puzzle - wait and trigger next puzzle
    public void SetPuzzleResults(int score, int level)
    {
        _playfieldState = ePlayfieldState.displayResults;

        SetOverlayPostGameValues(score, level);
    }