using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class Drill : MonoBehaviour { // [SerializeField] allows us to view and edit a // private variable when testing in the Unity Editor [Header("Debugging Variables")] [SerializeField] private int PowerUpgrades = 0; [SerializeField] private int CoolingUpgrades = 0; [SerializeField] private float _heat = 0; [SerializeField] private float _speed = 0; [SerializeField] private float _depth = 0; // selection outline private Outline _outline; // drill head child object public GameObject _drillBit; void Start() { // get the first child of the drill object _drillBit = this.transform.GetChild(0).gameObject; // get the outline component of this object _outline = this.GetComponent(); _outline.enabled = false; // start unselected } // Update is called once per frame void Update() { //TODO: Make the drill bit rotate based on the _speed variable instead of a constant number _drillBit.transform.Rotate(0, 500 * Time.deltaTime, 0); } public float GetCurrentSpeed() { return _speed; } public int GetCoolingUpgrades() { return CoolingUpgrades; } //TODO: Add missing accessor methods public void AddPowerUpgrade() { PowerUpgrades++; } //TODO: Add missing modifier method for CoolingUpgrades. /// /// Called by GameController when this drill becomes selected/unselected. /// public void SetSelected(bool selected) { if(_outline != null) { _outline.enabled = selected; } } }