void OnCollisionEnter(Collision collision) { GameObject other = collision.gameObject; if (other.layer == 10) { StatusMole mole = other.GetComponent <StatusMole> (); mole.MoleHP -= 0.5f; } }
void Start() { statusmole = GetComponent <StatusMole> (); }
void Start() { breaktimeslider = GameObject.Find("MoleBreakSlider").GetComponent <Slider> (); statusmole = GameObject.Find("mole").GetComponent <StatusMole> (); }
void Start() { slider = GameObject.Find("MoleHpSlider").GetComponent <Slider> (); statusmole = GameObject.Find("mole").GetComponent <StatusMole> (); }
void Start() { destination.x = this.gameObject.transform.position.x; destination.y = this.gameObject.transform.position.y; statusmole = GetComponent <StatusMole> (); }