예제 #1
0
    protected override void TakeHit()
    {
        base.TakeHit();

        if (hits - 1 != 0)
        {
            hits--;
            // update the text on the object
            SetText(hits.ToString());
            //GetComponent<SpriteRenderer>().color = CalculateColor();
        }
        else
        {
            _comboManager.AddToCombo();
            // remove from list of shapes and destroy
            List <GameObject> spawned = GameManager.instance.SpawnManager.SpawnedObjects;
            if (spawned != null)
            {
                spawned.Remove(gameObject);
            }
            GameManager.instance.ScoreManager.Score += ScoreAward;
            GameManager.instance.ScoreManager.UpdateScoreText();

            GameManager.instance.SpawnParticles(transform.position);

            Destroy(gameObject);
        }
    }
예제 #2
0
    protected override void TakeHit()
    {
        base.TakeHit();

        if (hits - 1 != 0)
        {
            hits--;
            // update the text on the object
            SetText(hits.ToString());
        }
        else
        {
            _comboManager.AddToCombo();
            // remove from list of shapes and destroy
            List <GameObject> spawned = GameManager.instance.SpawnManager.SpawnedObjects;
            if (spawned != null)
            {
                spawned.Remove(gameObject);
            }
            GameManager.instance.ScoreManager.Score++;
            GameManager.instance.ScoreManager.UpdateScoreText();
            Destroy(gameObject);
        }
    }