コード例 #1
0
    public bool ChangeWeapon(SpawnCode code, GameObject _parents, GameObject _child)
    {
        //언락 여부 체크
        if (!spawn.GetIsUnlocked(code))
        {
            return(false);
        }

        //장비 생성 & 할당
        string what = (code.ToString().Substring(0, 2));

        switch (what)
        {
        case "W0": spawn.GetWeapon_Sword(code, _child); break;

        case "W1": spawn.GetWeapon_Spear(code, _child); break;

        case "W2": spawn.GetWeapon_Bow(code, _child); break;
        }

        //무기 메커니즘 초기화
        _parents.GetComponent <PlayerStatus>().Init_Weapon();

        //서버 통신
        router.PostRouter(PostType.PLAYER_WEAPON_CHANGE, code);

        return(true);
    }