Example #1
0
    protected void DropITEM()
    {
        if (dropItemob == null)
        {
            return;
        }

        dropItemob.transform.position = this.transform.position;
        dropItemob.gameObject.SetActive(true);
        dropItemob.GetComponent <Rigidbody2D>().AddForce(Vector2.up * 25f, ForceMode2D.Impulse);
    }
Example #2
0
    //public override void TakeThis()
    //{
    //    base.TakeThis();



    //    //..애니매이션 실행
    //    //..기본 스프라이트 이미지 변경
    //}

    protected override void SetWhenHPzero()
    {
        //base.SetWhenHPzero();
        if (hp > 0)
        {
            sR.sprite = spriteArray[hp];
        }
        else
        {
            StateOn = false;
            //GetComponent<BoxCollider2D>().isTrigger = true;
            //GetComponent<Rigidbody2D>().simulated = false;

            EffectOb.SetActive(true);

            item.gameObject.SetActive(true);
            item.GetComponent <Rigidbody2D>().AddForce(Vector2.up * 25f, ForceMode2D.Impulse);
        }
    }