Ejemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        BugAI bug = collision.GetComponent <BugAI>();

        if (bug != null)
        {
            bug.Kill();
        }
    }
Ejemplo n.º 2
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        BugAI bug = collision.GetComponent <BugAI>();

        if (bug != null)
        {
            Sprite imageToUse = bug.GetComponentInChildren <SpriteRenderer>().sprite;
            bug.Kill();
            EatenBugs++;
            float stomachIndex = (float)EatenBugs / StomachCapacity;
            GameManager.I.UICtrl.StomachAdd(imageToUse, stomachIndex);

            frog.EatFeedback();
        }
    }