示例#1
0
    void OnTriggerStay(Collider c)
    {
        //Damage aratk = GameObject.Find("Damage").GetComponent<Damage>();

        if (c.gameObject == aboss)
        {
            witch_main Boss = GameObject.Find("Witch01").GetComponent <witch_main>();
            Destroy(gameObject, 5f);
            Boss.hp = Boss.hp - Damage.icebombdamage;
        }

        if (c.gameObject == bboss)
        {
            witch_creature witch = GameObject.Find("creature").GetComponent <witch_creature>();
            Destroy(gameObject, 5f);
            witch.hp = witch.hp - Damage.icebombdamage;
        }

        if (c.gameObject == cboss)
        {
            witch_creature2 witch2 = GameObject.Find("creature2").GetComponent <witch_creature2>();
            Destroy(gameObject, 5f);
            witch2.hp = witch2.hp - Damage.icebombdamage;
        }

        Destroy(gameObject, 5f);
    }
    void bossHP()
    {
        witch_creature witch = GameObject.Find("creature").GetComponent <witch_creature>();

        Hpbar.fillAmount = witch.hp / 300f;

        if (witch.hp <= 0)
        {
            Destroy(gameObject);
        }
    }
示例#3
0
    void OnTriggerEnter(Collider c)
    {
        Vector3 pos = c.GetComponent <Transform>().position;

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

        if (c.gameObject == aboss)
        {
            summon.gameObject.SetActive(true);
            summon.Play();
            witch_main Boss = GameObject.Find("Witch01").GetComponent <witch_main>();

            GameObject.Find("long_damage_sound").GetComponent <AudioSource>().Play();;
            Destroy(gameObject);
            for (int i = 0; i < 2; i++)
            {
                Boss.hp = Boss.hp - Damage.wizskill;
            }
        }

        if (c.gameObject == bboss)
        {
            summon.gameObject.SetActive(true);
            summon.Play();
            GameObject.Find("long_damage_sound").GetComponent <AudioSource>().Play();
            Destroy(gameObject);
            for (int i = 0; i < 2; i++)
            {
                witch_creature witch = GameObject.Find("creature").GetComponent <witch_creature>();
                witch.hp = witch.hp - Damage.wizskill;
            }
        }

        if (c.gameObject == cboss)
        {
            summon.gameObject.SetActive(true);
            summon.Play();
            GameObject.Find("long_damage_sound").GetComponent <AudioSource>().Play();
            Destroy(gameObject);
            for (int i = 0; i < 2; i++)
            {
                witch_creature2 witch2 = GameObject.Find("creature2").GetComponent <witch_creature2>();
                witch2.hp = witch2.hp - Damage.wizskill;
            }
        }

        Destroy(gameObject, 0.3f);
    }