//canEat -> boolean private bool canEat(Collider other) { //takes an object and checks whether it can be absorbed by the current object int currLvl = currentMassAsLevel(); //get the sizeLevel of the object that has been bumped into absorbScript = other.GetComponent <Absorbable>(); Debug.Log("Blob size Level: " + currLvl + "- other object level: " + absorbScript.getSizeLevel()); if (currLvl < absorbScript.getSizeLevel()) { //TODO: need to instantiate an object script that contains a method for fetching thier size level Debug.Log("just hit something we cant absorb"); return(false); } Debug.Log("just hit something we will absorb"); return(true); }
private void Awake() { source = GetComponent <AudioSource>(); player = GetComponent <HealthHaver>(); absorbable = GetComponent <Absorbable>(); }