Example #1
0
    public void TakeSetItem(ITEM_KIND _kind, int _count, float _power)
    {
        //Debug.Log ("#### GetItem > 구현해야함...");
        switch (_kind)
        {
        case ITEM_KIND.PLUS_BULLET:
            weaponStep += _count;
            if (weaponStep > Constant.WEAPON_STEP_MAX)
            {
                weaponStep = Constant.WEAPON_STEP_MAX;
            }
            break;

        case ITEM_KIND.PLUS_HEALTH:
            Debug.Log(" > health up");
            health += _count;
            if (health > HEALT_MAX)
            {
                health = HEALT_MAX;
            }
            break;

        case ITEM_KIND.PLUS_COIN:
            Debug.Log(" > Coin up");
            coin += _count;
            break;

        case ITEM_KIND.PLUS_POWER:
            Debug.Log(" > Power up");
            power += _power;
            break;
        }
    }
Example #2
0
    //--------------------------------
    // temporary Start()
    //--------------------------------
    //void Start (){
    //	InitReuse (ITEM_KIND.PLUS_BULLET, 1, 0);
    //}

    public void InitReuse(ITEM_KIND _k, int _count, float _power)
    {
        //Debug.Log ((int)kind);
        kind            = _k;
        count           = _count;
        power           = _power;
        renderer.sprite = sprites [(int)kind];

        velocity.Set(
            Random.Range(-1f, 1f),              //좌우 약간 튀게..
            maxJumpVelocity,                    //떨어지게...
            0f);
    }