void OnTriggerEnter(Collider c)
    {
        Vector3 pos = c.GetComponent <Transform>().position;

        summon.transform.position = pos + new Vector3(0, 1, 0);
        //Damage aratk = GameObject.Find("Damage").GetComponent<Damage>();

        if (c.gameObject == aboss)
        {
            summon.gameObject.SetActive(true);
            summon.Play();
            GameObject.Find("long_damage_sound").GetComponent <AudioSource>().Play();
            golem_main gol = GameObject.Find("golem").GetComponent <golem_main>();
            Destroy(gameObject);
            if (hall.activeSelf == false && hall2.activeSelf == false && hall3.activeSelf == false && hall4.activeSelf == false)
            {
                gol.hp = gol.hp - Damage.arskill;
            }
        }


        if (c.gameObject == hall)
        {
            summon.gameObject.SetActive(true);
            summon.Play();
            GameObject.Find("long_damage_sound").GetComponent <AudioSource>().Play();
            hall_archer gol = GameObject.Find("hall_archer").GetComponent <hall_archer>();

            Destroy(gameObject);
            gol.hp = gol.hp - 10;
        }
        Destroy(gameObject, 0.3f);
    }
Ejemplo n.º 2
0
    void bossHP()
    {
        golem_main Boss = GameObject.Find("golem").GetComponent <golem_main>();

        Hpbar.fillAmount = Boss.hp / 2250f;

        if (Boss.hp <= 0)
        {
            Destroy(gameObject);
        }
    }
    void OnTriggerStay(Collider c)
    {
        //Damage aratk = GameObject.Find("Damage").GetComponent<Damage>();

        if (c.gameObject == aboss)
        {
            golem_main Boss = GameObject.Find("golem").GetComponent <golem_main>();
            Destroy(gameObject, 5f);
            Boss.hp = Boss.hp - Damage.icebombdamage;
        }
        Destroy(gameObject, 5f);
    }
    // Start is called before the first frame update
    public void clicked()
    {
        golem_main witch = GameObject.Find("golem").GetComponent <golem_main>();

        witch.hp = witch.hp - 500;
    }