Beispiel #1
0
    public void GameStart()
    {
        if (CDataManager.Inst == null)
        {
            return;
        }
        if (CDataManager.Inst.PlayerRecord == null)
        {
            return;
        }

        Data.PlayerInfo playerInfo = CDataManager.Inst.PlayerRecord.PlayerInfo;

        if (playerInfo == null)
        {
            return;
        }

        if (string.IsNullOrEmpty(playerInfo.name))
        {
            CLoadingScene.LoadingScene("CreateUser");
        }
        else
        {
            CLoadingScene.LoadingScene("Lobby");
        }

        m_soundMgr.StopBgm(m_bgmSource);
    }
Beispiel #2
0
    public void CreateQuest()
    {
        //TODO: 퀘스트 생성 및 룸 생성

        Data.QuestInfo?questInfo = m_questInfoUI.SelectedQuest;

        if (questInfo == null)
        {
            if (m_messageUI != null)
            {
                m_messageUI.ShowSubMessage("Don't Quest Selected", 2f);
            }
            return;
        }

        CQuestManager.Inst.QuestSet(questInfo.Value);

        //TODO: 네트워크 매치 메이크 생성

        if (m_manager != null)
        {
            if (m_manager.matchMaker == null)
            {
                m_manager.StartMatchMaker();
            }

            //m_manager.matchMaker.CreateMatch(questInfo.Value.questName, 4, false, "", "", "", 0, 0, m_manager.OnMatchCreate);
            //return;
        }

        CSoundManager.Inst.StopBgm(m_bgmSource);
        CLoadingScene.LoadingScene("LevelRoot");
    }
Beispiel #3
0
    public void SaveUserData()
    {
        if (string.IsNullOrEmpty(m_name))
        {
            m_messageUI.ShowSubMessage("Please Input UserName", 2f);
            return;
        }

        //m_nNotset += m_playerInfo.gender == Gender.Male ? 100 : 0;

        Data.BoxInfo       boxInfo       = CDataManager.Inst.PlayerRecord.BoxInfo;
        Data.InventoryInfo inventoryInfo = CDataManager.Inst.PlayerRecord.InventoryInfo;

        AddEquipmentInBox(boxInfo);
        EquipmentSet(inventoryInfo);

        inventoryInfo.itemList.Add(CreateItem(0));
        boxInfo.itemList.Add(CreateItem(2));

        CDataManager.Inst.PlayerRecord.SaveUserData(m_name, m_Gender);

        CLoadingScene.LoadingScene("Lobby");

        if (CSoundManager.Inst != null)
        {
            CSoundManager.Inst.StopBgm(m_bgmAudio);
        }
    }
Beispiel #4
0
    public void QuestReset()
    {
        m_checkCount  = 0;
        m_deathCount  = 0;
        m_deathLimit  = DeathCountBase;
        m_selectQuest = null;
        m_questTarget = null;

        CLoadingScene.LoadingScene("Lobby");
    }
Beispiel #5
0
    IEnumerator WaitForScene(System.Action pDoneCbk)
    {
        while (mLoadingScene == null)
        {
            mLoadingScene = GameObject.FindObjectOfType(typeof(CLoadingScene)) as CLoadingScene;
            if (mLoadingScene == null)
            {
                yield return(0);
            }
        }

        mLoadingScene.mCamera.enabled = false;
        mInitialized = true;

        if (pDoneCbk != null)
        {
            pDoneCbk();
        }
    }
Beispiel #6
0
 public void GoToTitle()
 {
     CLoadingScene.LoadingScene("Title");
 }
Beispiel #7
0
    IEnumerator StartGame()
    {
        m_stageUI = CStageUIManager.Inst;

        while (m_stageUI == null)
        {
            yield return(null);
        }

        if (m_stageUI != null)
        {
            while (m_stageUI.MessageUI == null)
            {
                yield return(null);
            }

            while (!m_stageUI.MessageUI.IsLoaded)
            {
                yield return(null);
            }
        }

        #region ObjectPoolWait

        while (CObjectPool.Inst == null)
        {
            yield return(null);
        }

        while (CObjectPool.Inst.IsInit == false)
        {
            yield return(null);
        }

        #endregion

        //TODO: 플레이어 생성(임시)
        while (CRootLevel.Inst == null)
        {
            yield return(null);
        }

        if (!IsGameStart)
        {
            #region BossRespon

            CUnitData targetData = m_questManager.QuestTarget;

            if (targetData != null)
            {
                if (m_questManager.SelectQuest != null && m_questManager.SelectQuest.Value.mainTargetType == UnitType.Boss)
                {
                    GameObject bossGo = CObjectPool.Inst.GetUnit(UnitType.Boss, targetData.Index);

                    if (bossGo == null)
                    {
                        IsGameStart = true;
                        yield break;
                    }

                    CBossUnit boss = bossGo.GetComponent <CBossUnit>();

                    if (boss != null)
                    {
                        boss.ResetUnit();

                        while (!CRootLevel.Inst.SubLevels.ContainsKey(targetData.StayLevel[0]))
                        {
                            yield return(null);
                        }

                        CSubLevel startLevel = CRootLevel.Inst.SubLevels[targetData.StayLevel[0]];

                        bossGo.transform.parent = null;
                        boss.ResetUnit();
                        boss.StayLevel            = startLevel;
                        bossGo.transform.position = startLevel.SpwanPoints == null ?
                                                    startLevel.transform.position + Vector3.up * 5f : startLevel.SpwanPoints[0].transform.position + Vector3.up * 2f;
                        bossGo.transform.rotation = Quaternion.identity;
                        bossGo.SetActive(true);

                        if (startLevel.SpwanPoints != null)
                        {
                            while (boss.Movement == null)
                            {
                                yield return(null);
                            }

                            boss.Movement.MoveWays = startLevel.SpwanPoints[0].GetWay(0);
                        }
                    }
                    else
                    {
                        Destroy(bossGo);
                        CLoadingScene.LoadingScene("Lobby");
                        yield break;
                    }
                }
            }
            #endregion
            IsGameStart = true;

            #region PlyaerCreateTemp

            GameObject playerPrefab = Resources.Load <GameObject>("Prefabs/Character/Player");
            GameObject startGo      = GameObject.FindWithTag("StartPoint");
            m_startPoint = startGo == null ? null : startGo.transform;
            GameObject player = Instantiate(playerPrefab, m_startPoint == null ? Vector3.zero : m_startPoint.position, Quaternion.identity);
            player.name = playerPrefab.name;

            #endregion
        }

        yield return(null);

        Data.QuestInfo?questInfo = m_questManager.SelectQuest;

        if (questInfo != null)
        {
            m_stageUI.MessageUI.ShowMainMessage(questInfo.Value.areaName, 3f, new Color(0.8f, 0.5f, 0f, 0.5f), MessageClipType.QuestStart);
            yield return(new WaitForSeconds(3f));

            m_stageUI.MessageUI.ShowSubMessage(questInfo.Value.questName, 3f);
            yield return(null);
        }
        else
        {
            m_stageUI.MessageUI.ShowSubMessage("Quest Start", 3f);
            yield return(null);
        }
    }