Exemplo n.º 1
0
 void Start()
 {
     player_damage     = PlayerPrefs.GetInt("Player_dmg");
     binary_rain_skill = PlayerPrefs.GetInt("Binary_rain");
     fire_switch_skill = PlayerPrefs.GetInt("Fire_switch");
     stringer_skill    = PlayerPrefs.GetInt("Stringer");
     image             = GetComponent <Image>();
     healths           = GetComponentInParent <Enemy_health>();
     health            = (float)healths.HP;
     position_y        = 5f;
 }
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.tag == "enemy")
        {
            heal     = col.GetComponent <Enemy_health>();
            damage   = PlayerPrefs.GetInt("Stringer");
            heal.HP -= damage;

            if (heal.HP <= 0)
            {
                // gm[heal.id].SetActive(false)
                // Destroy(gm[heal.id]);
            }
        }
    }
    void OnTriggerStay2D(Collider2D col)
    {
        if (col.gameObject.tag == "enemy")
        {
            heal     = col.GetComponent <Enemy_health>();
            damage   = 1;
            heal.HP -= damage;

            if (heal.HP <= 0)
            {
                // gm[heal.id].SetActive(false)
                // Destroy(gm[heal.id]);
            }
        }
    }
 void Start()
 {
     Hp = GetComponentInParent <Enemy_health>();
 }