public Collectible GetHeldCollectible() { if (grabbedObject == null) { return(null); } if (grabbedObject.GetType().Equals(typeof(Collectible)) || grabbedObject.GetType().IsSubclassOf(typeof(Collectible))) { return((Collectible)grabbedObject); } return(null); }
private void ConsumePowerSource() { if (grabbedObject == null) { state = States.None; return; } if (grabbedObject.GetType().Equals(typeof(ResourceCube))) { ((ResourceCube)grabbedObject).UseEnergy(energyUsePerSecond * Time.deltaTime); } }