// Start is called before the first frame update void Start() { gMan = FindObjectOfType <GameManager>(); intObj = GetComponentInChildren <InteracableObject>(); totalMinerals = Random.Range(100, 500); }
// Update is called once per frame void Update() { if (bActivated && totalMinerals > 0 && gMan._inventory.hCurrent < gMan._inventory.hCapacity) { InvokeRepeating("Mining", 3, 3); bActivated = false; } if (intObj = null) { CancelInvoke("Mining"); gMan._ship.StopCoroutine("FireLaser"); gMan._ship.line.enabled = false; gMan._ship.bMining = false; gMan._ui.information.enabled = false; } if (gMan._inventory.hCurrent >= gMan._inventory.hCapacity) { CancelInvoke("Mining"); gMan._ship.StopCoroutine("FireLaser"); gMan._ship.line.enabled = false; gMan._ship.bMining = false; gMan._ui.information.enabled = false; } }