コード例 #1
0
ファイル: HeroCharacter.cs プロジェクト: ParkJuSung/soft
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.transform.tag == "monster")
        {
            if (!isCollision)
            {
                heroInformation.baseCharacterInformation.SubtractionHP(
                    collision.transform.GetComponent <MinionMonster>().miniMonster.basecharacterinformation.GetDamae());
                Debug.Log(heroInformation.baseCharacterInformation.GetHP());

                for (int i = 0; i < drawBar.GetSliderHListHPber().Count; i++)
                {
                    if (heroInformation.baseCharacterInformation.IsDie(i))
                    {
                        Destroy(drawBar.GetHHeadUpPosition(i));
                        Destroy(drawBar.GetHeroHPber(i));
                        Destroy(gameObject);

                        drawBar.RemoveHeroList(i);
                    }
                }
                isCollision = true;
            }
        }
    }
コード例 #2
0
    private void OnCollisionEnter(Collision collision)
    {
        if (collision.transform.tag == "monster")
        {
            if (!isCol)
            {
                heroInformation.baseCharacterInformation.SubtractionHP(
                    collision.transform.GetComponent <MinionMonster>().miniMonster.basecharacterinformation.GetDamae());
                Debug.Log(heroInformation.baseCharacterInformation.GetHP());
                isCol = true;
            }


            if (heroInformation.baseCharacterInformation.IsDie())
            {
                Destroy(drawBar.GetHHeadUpPosition());
                Destroy(drawBar.GetHeroHPber());
                Destroy(gameObject);
            }
        }
    }