public void Load(SaveStructure st)
    {
        List <ClientIdea> clist = st.charactorList_Client;
        List <HunterIdea> hlist = st.charactorList_Hunter;

        charaList.Clear();
        expireCharaQue.Clear();
        visitedToday.Clear();
        for (int i = 0; i < clist.Count; i++)
        {
            clist[i].SetCharaSprite();
            charaList.Add(clist[i]);
        }
        for (int i = 0; i < hlist.Count; i++)
        {
            hlist[i].SetCharaSprite();

            if (hlist[i].DidRentalWeapon()) //무기를 빌린게 이으면 무기를 정보에 따라 뽑아 만듦.
            {
                for (int j = 0; j < hlist[i].RentalWeapon.Count; j++)
                {
                    Weapon weapon = WeaponInfoManager.GetInstance().CreateWeapon(
                        hlist[i].RentalWeapon[j].weaponType,
                        hlist[i].RentalWeapon[j].IsBroken());

                    hlist[i].RentalWeapon[j] = weapon;
                }
            }

            charaList.Add(hlist[i]);
        }
    }
Esempio n. 2
0
    void Init()
    {
        selected = null;
        merchantWeaponDic.Clear();

        buyBtn.interactable = false;
        nowGold             = GoldManager.GetInstance().Gold;
        nowGoldTxt.text     = nowGold.ToString();

        int merchantWeaponCount = (int)E_Weapon.MAX;

        nowLang = LanguageManager.GetInstance().Language;

        for (int i = 0; i < merchantWeaponCount; i++)
        {
            string name    = "";
            string comment = "";
            int    price   = merchantWeaponSheet.dataArray[i].Price;
            switch (nowLang)
            {
            case E_Language.KOREAN:
                name    = weaponInfo.dataArray[i].Namekor;
                comment = merchantWeaponSheet.dataArray[i].Mwcmtkor;
                break;

            case E_Language.ENGLISH:
                name    = weaponInfo.dataArray[i].Nameeng;
                comment = merchantWeaponSheet.dataArray[i].Mwcmteng;
                break;
            }

            int num = i;

            GameObject btn    = Instantiate(buyWeaponBtn, buyWeaponContent.transform);
            Weapon     weapon = WeaponInfoManager.GetInstance().CreateWeapon((E_Weapon)i);


            btn.GetComponent <Button>().onClick.AddListener(
                () =>
            {
                SelectWeapon(num);
            }

                );
            merchantWeaponDic.Add(num, new merchantWeapon(btn, weapon, price, comment));

            SetTxtsWeaponBtn(weapon, btn, price);
        }
        ShowDefaultComment();
        GoldAdjustShow(0);
    }
Esempio n. 3
0
    public void Load(SaveStructure st)
    {
        RenewMobEviInven(st.inventoryMobEvi);

        Dictionary <E_Weapon, int> weaponTemp = st.inventoryWeapon;

        weaponInventory = new List <weaponInven>();
        Dictionary <E_Weapon, int> .Enumerator enu = weaponTemp.GetEnumerator();
        while (enu.MoveNext())
        {
            weaponInventory.Add(
                new weaponInven(
                    WeaponInfoManager.GetInstance().CreateWeapon(enu.Current.Key),
                    enu.Current.Value
                    ));
        }
    }
Esempio n. 4
0
    public void OnClickBuy()
    {
        if (selected == null)
        {
            Debug.LogError("웨폰 구입 선택 오류0");
        }
        merchantWeapon selectedWeapon = merchantWeaponDic[(int)selected];
        Weapon         weapon         = WeaponInfoManager.GetInstance().CreateWeapon(selectedWeapon.weapon.weaponType);
        List <Weapon>  temp           = new List <Weapon>();

        temp.Add(weapon);

        Inventory.GetInstance().AddWeaponsToInven(temp);
        GoldManager.GetInstance().AdjustGold(-1 * selectedWeapon.price, GoldManager.E_PayType.BUY_BY_MERCHANT);
        HideTab();
        ShowTab();
        //인벤토리에 넣어주고.
        //골드 까주고.
    }
Esempio n. 5
0
    public void NewStartGame()  //완전 새로운 게임 시작.
    {
        SaveManager.GetInstance().DeleteSavedGame();

        SettingUIManager.GetInstance().PauseBtn.interactable = true;
        Debug.Log("게임매니져 - 뉴스타트게임-");

        InGameTimeManager.GetInstance().SetMainTime(1, 1, 1, 1, 1);
        WholeMonsterRiskManager.GetInstance().Init();
        PhaseManager.GetInstance().InitForNewStart();
        GoldManager.GetInstance().SetGold(Constant.newStartGolds);
        QuestManager.GetInstance().QuestDic.Clear();
        Inventory.GetInstance().MobEvidenceInven.Clear();
        Inventory.GetInstance().WeaponInventory.Clear();
        GameEndJudgeManager.GetInstance().InitForNewStart();
        CharactorManager.GetInstance().InitForNewStart();
        TextManager.GetInstance().DistributedNames.Clear();

        //모킹/
        for (int i = 0; i < (int)E_Monster.MAX; i++)
        {
            for (int j = 0; j < (int)E_Evidence.MAX; j++)
            {
                Inventory.GetInstance().AddMobEvi(new QuestPerMob((E_Monster)i, (E_Evidence)j, 3));
            }
        }
        List <Weapon> temp = new List <Weapon>();
        Weapon        w    = WeaponInfoManager.GetInstance().CreateWeapon(E_Weapon.AXE);

        temp.Add(w);
        Inventory.GetInstance().AddWeaponsToInven(temp);

        //모킹종료


        StartCoroutine(LoadingScene("QuestRoom_1", StartNewMorning));
    }
Esempio n. 6
0
    IEnumerator Start()
    {
        Debug.Log("게임매니저 스타트");

        Screen.autorotateToLandscapeLeft      = false;
        Screen.autorotateToLandscapeRight     = false;
        Screen.autorotateToPortrait           = false;
        Screen.autorotateToPortraitUpsideDown = false;


        //Screen.SetResolution(1920, 1080, false);

        Screen.SetResolution(1080, 1920, true);


        Screen.orientation = ScreenOrientation.Landscape;
        firstLogin         = false;
        object n = new object();

        lock (n)
        {
            LogInGooglePlay();
        }


        DontDestroyOnLoad(this.gameObject);
        screenImage.gameObject.SetActive(false);

        dayOnGoing     = false;
        dayDone        = false;
        timeCursor     = 0f;
        wineDineCursor = 0f;

        TextManager.GetInstance().Init();
        LanguageManager.GetInstance().Init();
        MobEviInfoManager.GetInstance().Init();
        WeaponInfoManager.GetInstance().Init();
        UIGeneralTextsManager.GetInstance().Init(); //이닛단에서 랭귀지 애드 리스너도 함.



        StartSceneUIManager ssUI = GameObject.Find("StartCanvas").GetComponent <StartSceneUIManager>();

        LanguageManager.GetInstance().AddListnerLanguageChange(ssUI.langChanged);
        ssUI.gameObject.SetActive(false);
        while (Social.localUser.authenticated == false && false == firstLogin)  //인증 되는 거 기다림., 세이브 매니저 이닛도 기다림.
        {
            Debug.Log("인증 기다리는중");
            yield return(new WaitForSeconds(2f));
        }

        Debug.Log("게임매니저 - 인증 끝 확인");
        yield return(new WaitForSeconds(2f));


        bool saved = SaveManager.GetInstance().IsThereSavedGame();

        if (saved)
        {
            Debug.Log("게임매니저 - 세이브 있음 확인.");
            LanguageManager.GetInstance().SetLanguage(SaveManager.GetInstance().GetSavedGameLang());
        }
        ssUI.gameObject.SetActive(true);

        ssUI.InitStartUI();
    }