예제 #1
0
    public virtual void ObjInit()
    {
        state = enObjState.normal;
        life  = conf.life;

        anim = this.GetComponent <Animator>();
    }
예제 #2
0
    public virtual void Hurt(int val)
    {
        life -= val;
        if (life <= 0)
        {
            state = enObjState.die;

            if (itemList != null)
            {
                for (int i = 0; i < itemList.Count; i++)
                {
                    BaseObject obj = InGameManager.GetInstance().inGameObjectManager.AddObj(itemList[i]);
                    obj.transform.position = transform.position;
                }
            }
        }
    }