Exemple #1
0
    // Use this for initialization
    void Start()
    {
        _userInput             = new LFUserInput();
        _userInput.exitAction += CancelAction;
        _sessionManager        = GameObject.FindGameObjectWithTag("tSession").GetComponent <LFSessionManager>();

        if (_sessionManager != null && _sessionManager.GetCurrentSession() != null)
        {
            _session = _sessionManager.GetCurrentSession();
        }

        playerName.text = _session.PlayerName;
    }
    private void ShowResult()
    {
        if (coinLabel != null && _sessionManager != null && _sessionManager.GetCurrentSession() != null)
        {
            LFGameSession session = _sessionManager.GetCurrentSession();
            coinLabel.text = "COINS = " + session.CoinCount;
        }

        if (timeLabel != null && _sessionManager != null && _sessionManager.GetCurrentSession() != null)
        {
            LFGameSession session = _sessionManager.GetCurrentSession();
            timeLabel.text = "Time = " + (int)session.GameTime;
        }
    }
Exemple #3
0
    public void CleanAction()
    {
        GetComponent <AudioSource>().Play();

        if (_sessionManager != null && _sessionManager.GetCurrentSession() != null)
        {
            _sessionManager.Clean();
            _sessionManager.Save();
            CreateLeadboardRows();
        }
    }
Exemple #4
0
    private void PlayerDidGetCoin()
    {
        Debug.Log("PlayerDidGetCoin " + Time.deltaTime);

        if (_sessionManager != null)
        {
            _sessionManager.GetCurrentSession().CoinCount += 1;

            if (guiController != null)
            {
                guiController.SetCoinCount(_sessionManager.GetCurrentSession().CoinCount);
            }

            if (_sessionManager.GetCurrentSession().CoinCount == 5 && _enemyGenerator != null)
            {
                _enemyGenerator.CreateZombie();
            }
            else if (_sessionManager.GetCurrentSession().CoinCount == 10 && _enemyGenerator != null)
            {
                _enemyGenerator.CreateMummy();
            }
            else if (_sessionManager.GetCurrentSession().CoinCount == 20 && _enemyGenerator != null)
            {
                _enemyGenerator.FindPlayerMode();
            }
            else if (_sessionManager.GetCurrentSession().CoinCount > 20 && _enemyGenerator != null)
            {
                _enemyGenerator.AddSpeed(1.05f);
            }
        }
    }
Exemple #5
0
    // Use this for initialization
    void Start()
    {
        _rowList        = new List <GameObject> ();
        _sessionManager = GameObject.FindGameObjectWithTag("tSession").GetComponent <LFSessionManager>();

        if (_sessionManager != null && _sessionManager.GetCurrentSession() != null)
        {
            CreateLeadboardRows();
        }

        _userInput             = new LFUserInput();
        _userInput.exitAction += CancelAction;
    }