void Start() { //Start Values stillSwinging = false; actionAborted = false; ic = controller.GetComponent <InventoryController>(); gc = controller.GetComponent <GatherableController>(); pi = gameObject.GetComponent <PlayerInteraction>(); pat = gameObject.GetComponent <PlayerAttributes>(); pm = gameObject.GetComponent <PlayerMovement>(); }
void Start() { ic = controller.GetComponent <InventoryController>(); gc = controller.GetComponent <GatherableController>(); //Check through the existing gatherables for (int i = 0; i < gc.gatherables.Count; i++) { //Check for a match with this gatherable in the controller if (this.gameObject.name == gc.gatherables[i].name) { //Take the variables from the controller maxGatherAmount = gc.gatherables[i].gatherAmount; replenishTimer = gc.gatherables[i].respawnTimer; item = gc.gatherables[i].item; //Set the gatherable amount to it's max gatherAmount = maxGatherAmount; } } }