void OnCollisionEnter(Collision collision)
    {
        GameObject other = collision.gameObject;

        if (other.layer == 10)
        {
            StatusMole mole = other.GetComponent <StatusMole> ();
            mole.MoleHP -= 0.5f;
        }
    }
Example #2
0
 void Start()
 {
     statusmole = GetComponent <StatusMole> ();
 }
Example #3
0
 void Start()
 {
     breaktimeslider = GameObject.Find("MoleBreakSlider").GetComponent <Slider> ();
     statusmole      = GameObject.Find("mole").GetComponent <StatusMole> ();
 }
Example #4
0
 void Start()
 {
     slider     = GameObject.Find("MoleHpSlider").GetComponent <Slider> ();
     statusmole = GameObject.Find("mole").GetComponent <StatusMole> ();
 }
Example #5
0
 void Start()
 {
     destination.x = this.gameObject.transform.position.x;
     destination.y = this.gameObject.transform.position.y;
     statusmole    = GetComponent <StatusMole> ();
 }