예제 #1
0
    public void showResult(bool isVictory)
    {
        monsterKilled.text = GameplayCounter.getInstance().MonsterKilled.ToString();
        rubyCollected.text = GameplayCounter.getInstance().RubyCollected.ToString();

        if (isVictory)
        {
            statusText.sprite = spVictory;
            expGained.text    = "+ 100";
            nextLevelButton.SetActive(true);
        }
        else
        {
            statusText.color  = new Color(1f, 0f, 0f);
            statusText.sprite = spDefeat;
            expGained.text    = "+ 0";
            nextLevelButton.SetActive(false);
        }

        ProgressSerial progressSerial = ProgressSerial.getInstance();

        progressSerial.RubyToSave += GameplayCounter.getInstance().RubyCollected;
        progressSerial.ExpToSave  += isVictory ? 100 : 0;
        progressSerial.saveData();


        gameplayUI.SetActive(false);
        resultPanel.SetActive(true);
    }
예제 #2
0
    protected override void OnDied()
    {
        base.OnDied();
        GetComponent <Collider2D>().enabled = false;
        EnemyDie?.Invoke(this, EventArgs.Empty);

        GameplayCounter.getInstance().addMonster();
    }
예제 #3
0
 private void OnCollisionStay2D(Collision2D collision)
 {
     if (collision.gameObject.tag == "DungeonEntrance")
     {
         if (Input.GetKeyDown(KeyCode.F))
         {
             GameplayCounter.getInstance().restartCounter();
             SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
         }
     }
     else if (collision.gameObject.tag == "NPC")
     {
         // Load Skill Panel
         if (Input.GetKeyDown(KeyCode.F))
         {
             NPCName.SetActive(false);
             OnSkillPanelClick();
         }
     }
 }
예제 #4
0
 public override void Consume()
 {
     GameplayCounter.getInstance().addRuby();
     Destroy(gameObject);
 }
 public void nextLevel()
 {
     GameplayCounter.getInstance().restartCounter();
     SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
 }