} // end _RHUNTCLICKER( public void _MHuntClicker() { // update the resource manager when the button is clicked Resource_Manager resourceManagerScript = resourceManager.GetComponent<Resource_Manager>(); Worker_Manager workerManagerScript = workerManager.GetComponent<Worker_Manager>(); Event_Manager_System eventManagerScript = eventManager.GetComponent<Event_Manager_System>(); // if the button is off cooldown add time to cooldown then increase the resource count if (mHuntOffCooldown) { if (Random.Range(1, 10) + mHuntDeathMod + ((float)workerManagerScript.workersMonsterHunt / 2) <= 7) { if (workerManagerScript.workersMonsterHunt > 0) { workerManagerScript.workersMonsterHunt -= Random.Range(1, 3); if (workerManagerScript.workersMonsterHunt < 0) { workerManagerScript.workersMonsterHunt = 0; } // end setting the workers to 0 is they are lower } // end REMOVE WORKER eventManagerScript.mHuntCount += 1; } // end CHECK IF HUNT SUCCESSFUL else { mHuntCooldownTimer = Time.time + mHuntCooldownLength; resourceManagerScript.mBone += resourceManagerScript.mBoneClickIncrease; resourceManagerScript.mTeeth += resourceManagerScript.mTeethClickIncrease; resourceManagerScript.mPelt += resourceManagerScript.mPeltClickIncrease; resourceManagerScript.food += resourceManagerScript.mMeatClickIncrease; resourceManagerScript.mScale += resourceManagerScript.mScaleClickIncrease; } // end ELSE } } // end MHUNTCLICKER
// Update is called once per frame void Update() { Resource_Manager resourceManagerScript = resourceManager.GetComponent <Resource_Manager>(); Event_Manager_System eventManagerScript = eventManager.GetComponent <Event_Manager_System>(); if (Input.GetKey(KeyCode.P)) { resourceManagerScript.wood += 1000; } if (Input.GetKey(KeyCode.O)) { resourceManagerScript.stone += 1000; } if (Input.GetKey(KeyCode.I)) { resourceManagerScript.bone += 1000; } if (Input.GetKey(KeyCode.U)) { resourceManagerScript.teeth += 1000; } if (Input.GetKey(KeyCode.Y)) { resourceManagerScript.fur += 1000; } if (Input.GetKey(KeyCode.L)) { resourceManagerScript.mBone += 1000; } if (Input.GetKey(KeyCode.K)) { resourceManagerScript.mTeeth += 1000; } if (Input.GetKey(KeyCode.J)) { resourceManagerScript.mPelt += 1000; } if (Input.GetKey(KeyCode.H)) { resourceManagerScript.iron += 1000; } if (Input.GetKey(KeyCode.M)) { resourceManagerScript.steel += 1000; } if (Input.GetKey(KeyCode.N)) { resourceManagerScript.coal += 1000; } if (Input.GetKey(KeyCode.B)) { resourceManagerScript.leather += 1000; } if (Input.GetKey(KeyCode.I)) { resourceManagerScript.mScale += 1000; } if (Input.GetKey(KeyCode.G)) { resourceManagerScript.food += 1000; } if (Input.GetKey(KeyCode.V)) { resourceManagerScript.herb += 1000; } if (Input.GetKey(KeyCode.R)) { resourceManagerScript.ironOre += 1000; } if (Input.GetKey(KeyCode.F)) { resourceManagerScript.relic += 1000; } if (Input.GetKey(KeyCode.C)) { eventManagerScript.mHuntCount += 10; } }