Пример #1
0
        private void InitBuiltInEvents()
        {
            onKnifeHitOnKnife.AddListener(delegate
            {
                StartCoroutine(StartGameOver());
            });
            onKnifeHitOnWood.AddListener(delegate
            {
                RequestNewShoot();

                GameObject go = Instantiate(woodParticle, Vector3.down * 1.5f, Quaternion.identity);
                Destroy(go, 1f);

                scorer.AddScore(1);
                onScore.Invoke();
            });
            onFruitSlice.AddListener(delegate
            {
                scorer.AddScore(2);
                onScore.Invoke();

                GameObject go = Instantiate(fruitsParticle, Vector3.down * 1.5f, Quaternion.identity);
                Destroy(go, 1f);

                scorer.AddFruits(1);
            });
        }
Пример #2
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     if (collider.tag == "Score" && isAlive())
     {
         scorer.AddScore();
         collider.GetComponent <AudioSource>().Play();
     }
 }
Пример #3
0
 public void DoDamage()
 {
     // die right away when recieving damade
     if (m_Animator.GetCurrentAnimatorStateInfo(0).IsName("Base Layer.SimpleLocomotion"))
     {
         m_Animator.SetBool("Die", true);
         Scorer.AddScore();
     }
 }
 public void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Ingredient")
     {
         if (!isBonusZone)
         {
             scorer.AddIngredient(other.GetComponent <IngredientScript>().kind);
         }
         scorer.AddScore(scoreAmount);
     }
 }
Пример #5
0
    async Task LevelUp()
    {
        state = GameState.LevelUp;

        // 到達したレベルを記録として用いる (not クリアしたレベル)
        // You reached Level x in t seconds! 的な
        score.AddScore(MaxTime - timeLeft, examiner.CurrentLevel + 1);

        audioManager.PlayLevelUp();
        await textManager.ShowLevelUp(0.8f);

        examiner.GoToNextLevel();
        StartLevel();
    }
Пример #6
0
    private void ground()
    {
        delta = ((((int)(transform.position.z / 10)) * 10) - (int)transform.position.z);
        if (Math.Abs(delta) >= 9 && prevdelta != delta)
        {
            step++;
            if (GameState.state == GameState.State.Play)
            {
                scoreboard.AddScore();
            }
        }
        prevdelta = delta;

        if (step >= 2)
        {
            step = 0;
            Vector3 tilesPos = new Vector3(((int)(transform.position.x / 10)) * 10f, -1.34f, (((int)(transform.position.z / 10)) * 10f) + 90);
            if (last != tilesPos)
            {
                last = tilesPos;
                Debug.Log(tilesPos);
                objects(tilesPos);
                Instantiate(tileFab, tilesPos, tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(-20, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(20, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(-40, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(40, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(-60, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(60, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(-80, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(80, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(-100, 0, 0), tileFab.transform.rotation);
                Instantiate(tileFab, tilesPos + new Vector3(100, 0, 0), tileFab.transform.rotation);
            }
        }
    }
Пример #7
0
 public void DoClick()
 {
     Scorer.AddScore(-Cost);
     Quantity += 1;
     Cost     += Cost * 20 / 100;
 }