private void OnTriggerEnter2D(Collider2D collision) { BugAI bug = collision.GetComponent <BugAI>(); if (bug != null) { bug.Kill(); } }
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(); } }