Esempio n. 1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        GameObject   go    = GameObject.Find("Sword");
        SwordSwinger sword = go.GetComponent <SwordSwinger>();

        if (col.gameObject.tag == "Sword" && !sword.canSwing)
        {
            health -= 1;
        }
    }
Esempio n. 2
0
 void Start()
 {
     m_Animator     = gameObject.GetComponent <Animator>();
     m_guid         = gameObject.GetComponent <Guid>();
     m_swordSwinger = gameObject.transform.FindChild("SwordSwinger").GetComponent <SwordSwinger>();
 }