protected override void NonInteractiveObjectCollision(NonInteractiveObject other) { //if this Player is colliding with an Item then check to see if it should be picked up if (input.pickupDrop && other.GetType().IsSubclassOf(typeof(Item))) { Item item = (Item)other; for (int i = 0; i < PlayerInput.NUM_ITEMS; i++) { if (input.items(i)) { item.Pickup(this, i); return; } } item.Pickup(this); } }
protected override void NonInteractiveObjectCollision(NonInteractiveObject other) { }
public void AddToGame(NonInteractiveObject add) { addNonInteractives.Add(add); }
public void RemoveFromGame(NonInteractiveObject remove) { removeNonInteractives.Add(remove); }
//Methods OnTriggerStay2D and OnCollsionEnter2D call depending on what it overlapped/collided with to catagorize the overlap/collsion protected abstract void NonInteractiveObjectCollision(NonInteractiveObject other);