public override bool Preform(GameObject _agent) { Caveman cm = _agent.GetComponent <Caveman>(); cm.energy -= cost; cm.AddSpears(3); //BackpackComponent bp = _agent.GetComponent<BackpackComponent>(); //bp.spears++; pickedUp = true; return(true); }
public override bool Preform(GameObject _agent) { if (startTime == 0) { startTime = Time.time; } if (Time.time - startTime > makeDuration) { Caveman cm = _agent.GetComponent <Caveman>(); cm.energy -= cost; cm.AddSpears(3); BackpackComponent bp = _agent.GetComponent <BackpackComponent>(); bp.rocks--; bp.sticks--; made = true; } return(true); }