Exemplo n.º 1
0
    public bool ChangeArmor(SpawnCode code, GameObject _parents, GameObject _child)
    {
        //언락 여부 체크
        if (!spawn.GetIsUnlocked(code))
        {
            return(false);
        }

        //캐릭터 스테이터스 초기화
        PlayerStatus ps = _parents.GetComponent <PlayerStatus>();

        ps.Init_HpDefence();

        //장비 생성 & 할당, 서버 통신
        Base_Armor ar;
        string     what = (code.ToString().Substring(0, 1));

        switch (what)
        {
        case "A":
            ar = spawn.GetArmor_Amulet(code, _child);
            ar.Execute(ps);
            router.PostRouter(PostType.PLAYER_AMULET_CHANGE, code);
            break;

        case "S":
            ar = spawn.GetArmor_Stone(code, _child);
            ar.Execute(ps);
            router.PostRouter(PostType.PLAYER_STONE_CHANGE, code);
            break;
        }

        return(true);
    }