Exemplo n.º 1
0
    //////////////////////////////////////////////////////////////////////////////////
    //CutScene
    public void ShowCutScene(eSceneType type)
    {
        if (Network.BattleStageInfo == null || Network.BattleStageInfo.Difficulty == pe_Difficulty.Hard)
        {
            return;
        }
        if (CutsceneInfo != null)
        {
            CurrentMenu = GameMenu.Battle;  // 삭제하면 튜토 1-3에서 클릭안되는 버그생김

            if (CutsceneInfo.CutSceneInfo.SceneType == type && CutsceneInfo.Targets.Count > 0)
            {
                TimeManager.Instance.SetPause(true);
                bShowed = true;
                TutorialDialog obj = NGUITools.AddChild(contents.gameObject, DialogPrefab).GetComponent <TutorialDialog>();
                obj.Init(CutsceneInfo.Targets[0]);
                CutsceneInfo.Targets.RemoveAt(0);
                m_Prefabs.Add(obj.gameObject);
                gameObject.SetActive(true);
                return;
            }
            else
            {
                CutsceneInfo = null;
            }
            return;
        }
        if ((type == eSceneType.PreAll || type == eSceneType.PreAll_Wave3) && CheckBattleStart() == true)
        {
            SetConditionOK();
        }
    }
Exemplo n.º 2
0
        /// <summary>
        /// 创建场景
        /// </summary>
        /// <param name="scene_type"></param>
        /// <returns></returns>
        public BaseScene CreateScene(uint scene_type)
        {
            BaseScene  new_scene = null;
            eSceneType type      = SceneID.GetSceneTypeByID(scene_type);

            if (type == eSceneType.CITY)
            {//主城场景:同类型只存在一个
                if (m_city_scenes.TryGetValue(scene_type, out new_scene))
                {
                    return(new_scene);
                }
            }
            //创建场景
            switch (type)
            {
            case eSceneType.CITY: new_scene = new CityScene(); break;

            case eSceneType.BATTLE: new_scene = new BaseScene(); break;

            default: Log.Warning("错误的场景类型:" + scene_type); return(null);
            }
            new_scene.Setup(scene_type, ++m_scene_guid);
            m_scenes.Add(new_scene.scene_obj_idx, new_scene);

            if (type == eSceneType.CITY)
            {
                m_city_scenes.Add(scene_type, new_scene);
            }
            else if (type == eSceneType.BATTLE)
            {
            }

            return(new_scene);
        }
Exemplo n.º 3
0
 private void SendEventToAfterLoad(eSceneType eLoadScene)
 {
     foreach (var callback in afterLoadSceneEvents)
     {
         callback(eLoadScene);
     }
 }
Exemplo n.º 4
0
    void DisableScene(eSceneType _type)
    {
        // Scene UI 삭제
        UI_Tools.Instance.Clear();

        switch (_type)
        {
        case eSceneType.SCENE_NONE:
            break;

        case eSceneType.SCENE_TITLE:
            break;

        case eSceneType.SCENE_GAME:
        {
            UI_Tools.Instance.HideUI(eUIType.PF_UI_INGAME);
            SkillManager.Instance.ClearSkill();
        }
        break;

        case eSceneType.SCENE_LOBBY:
            LobbyManager.Instance.DisableLobby();
            break;

        default:
            break;
        }
    }
Exemplo n.º 5
0
        //----------------------------------------------------------------------------
        private void OnShowLoadingUIByType(eSceneType type)
        {
            switch (type)
            {
            case eSceneType.CREATEROLE_SCENE:
                break;

            case eSceneType.NEWBIE_SCENE_OLD:
                break;

            case eSceneType.LOBBY_SCENE:
                Messenger.Broadcast(DgMsgID.DgMsg_ShowUIOneParam, "UILoadingCtrl", (object)m_curTexture);
                break;

            case eSceneType.COMMON_SCENE:
                break;

            case eSceneType.BATTLE_SCENE:
                break;

            case eSceneType.UNKNOWN_REGION:
                break;

            default:
                break;
            }
        }
Exemplo n.º 6
0
    public bool CheckCutScene(eSceneType type)
    {
        if (Network.BattleStageInfo == null || Network.BattleStageInfo.Difficulty == pe_Difficulty.Hard)
        {
            return(false);
        }
        if (type != eSceneType.Post)
        {
            var clear_data = MapClearDataManager.Instance.GetData(Network.BattleStageInfo);
            if (clear_data != null && clear_data.clear_rate > 0)
            {
                return(false);
            }
        }
        else
        {
            if (first_clear == false)
            {
                return(false);
            }
        }
        TutorialInfo _CutsceneInfo = TutorialInfoManager.Instance.GetCutScene(type, Network.BattleStageInfo);

        if (_CutsceneInfo != null && _CutsceneInfo.Targets.Count > 0)
        {
            CutsceneInfo = _CutsceneInfo;
            return(true);
        }

        return(false);
    }
Exemplo n.º 7
0
        //----------------------------------------------------------------------------
        public Copy Constract_Copy(string strCopyName, StageLayer layer)
        {
            Copy        newCopy = null;
            XmlDocument xmlDouc = new XmlDocument();
            string      XmlData = FileSystem.Instance().LoadGameData(strCopyName + ".xml");

            xmlDouc.LoadXml(XmlData);
            XmlElement copyElement = xmlDouc.SelectSingleNode("Copy") as XmlElement;

            if (copyElement == null)
            {
                return(null);
            }
            int        nType = int.Parse(copyElement.GetAttribute("TypeID"));
            eSceneType type  = eSceneType.BATTLE_SCENE;

            type    = GetCopyType(nType);
            newCopy = CreateCopy(type, layer);
            if (!newCopy.Create(copyElement, ref strCopyName, type))
            {
                newCopy = null;
                return(null);
            }
            xmlDouc = null;
            return(newCopy);
        }
Exemplo n.º 8
0
    void ComplateLoad(eSceneType _type)
    {
        switch (_type)
        {
        case eSceneType.SCENE_NONE:
            break;

        case eSceneType.SCENE_TITLE:
            break;

        case eSceneType.SCENE_GAME:
        {
            GameManager.Instance.GameInit();
            GameManager.Instance.LoadGame();
        }
        break;

        case eSceneType.SCENE_LOBBY:
        {
            LobbyManager.Instance.LoadLobby();
        }
        break;

        default:
            break;
        }
    }
Exemplo n.º 9
0
        //----------------------------------------------------------------------------
        public void CheckLoadingType(GameStateType stateType)
        {
            eSceneType type = eSceneType.BATTLE_SCENE;

            switch (stateType)
            {
            case GameStateType.GST_Invaild:
                break;

            case GameStateType.GST_Main:
                break;

            case GameStateType.GST_Loading:
                break;

            case GameStateType.GST_Login:
                break;

            case GameStateType.GST_Update:
                break;

            case GameStateType.GST_Logo:
                break;

            case GameStateType.GST_Lobby:
                type = eSceneType.LOBBY_SCENE;
                break;

            default:
                type = eSceneType.BATTLE_SCENE;
                break;
            }
            Messenger.Broadcast(DgMsgID.DgMsg_ShowLoadingUIByType, type);
        }
Exemplo n.º 10
0
 private async void GetLoadList(eSceneType eType, Action <List <Dictionary <string, SHLoadData> > > pCallback)
 {
     pCallback(new List <Dictionary <string, SHLoadData> >()
     {
         await Table.GetLoadList(eType),
         await Resources.GetLoadList(eType)
     });
 }
Exemplo n.º 11
0
    // 유틸 : 씬 변경시 처리해야할 하드한 작업들
    void PerformanceToChangeScene(eSceneType eCurrent, eSceneType eChange)
    {
        // 씬 변경 이벤트 콜
        SendCallback(eCurrent, eChange);

        // 히스토리 남기기
        SetHistory(eChange);
    }
Exemplo n.º 12
0
        public void ChangeScene(eSceneType sceneType)
        {
            var loadingSprite = getRenderWindow().LoadSprite(ResourcePaths.LoadingScreen, Palettes.Loading, new Point(300, 400));

            getRenderWindow().Clear();
            getRenderWindow().Draw(loadingSprite);
            getRenderWindow().Sync();
            nextScene = getScene(sceneType);
        }
Exemplo n.º 13
0
    public void UnloadScene(eSceneType eType)
    {
        if (false == IsLoadedScene(eType))
        {
            return;
        }

        SceneManager.UnloadSceneAsync(eType.ToString());
    }
Exemplo n.º 14
0
    void AddData(eSceneType eType, string strData)
    {
        if (false == m_pData.ContainsKey(eType))
        {
            m_pData.Add(eType, new List <string>());
        }

        strData = strData.ToLower();
        m_pData[eType].Add(strData);
    }
Exemplo n.º 15
0
    public void LoadScene(eSceneType _type, bool _asyne = true)
    {
        if (CurrentState == _type)
        {
            return;
        }

        NextState = _type;
        IsAsyc    = _asyne;
    }
Exemplo n.º 16
0
    // 인터페이스 : 이전 씬 인가?
    public bool IsBeforeScene(eSceneType eType)
    {
        int iLastIndex = m_pHistory.Count - 1;

        if (0 > iLastIndex)
        {
            return(false);
        }

        return(m_pHistory[iLastIndex].m_eTo == eType);
    }
Exemplo n.º 17
0
    // 인터페이스 : 씬 이동
    public void GoTo(eSceneType eChange)
    {
        // 알리아싱
        eSceneType eCurrent = GetCurrentScene();

        // 씬 변경시 처리해야 할 여러가지 작업들
        PerformanceToChangeScene(eCurrent, eChange);

        // 로드명령
        ExcuteGoTo(eChange);
    }
Exemplo n.º 18
0
    // 유틸 : 로드 리스트
    List <Dictionary <string, SHLoadData> > GetLoadList(eSceneType eType)
    {
        var pLoadList = new List <Dictionary <string, SHLoadData> >();

        pLoadList.Add(ServerData.GetLoadList(eType));
        pLoadList.Add(TableData.GetLoadList(eType));
        pLoadList.Add(ResourcesData.GetLoadList(eType));
        pLoadList.Add(AssetBundleData.GetLoadList(eType));

        return(pLoadList);
    }
Exemplo n.º 19
0
    public List <string> GetPreLoadResourcesList(eSceneType eType)
    {
        JsonPreLoadResourcesTable pTable = GetTable <JsonPreLoadResourcesTable>();

        if (null == pTable)
        {
            return(new List <string>());
        }

        return(pTable.GetData(eType));
    }
Exemplo n.º 20
0
    // 인터페이스 : X씬을 거친적이 있는가?
    public bool IsPassedScene(eSceneType eType)
    {
        foreach (var pHistory in m_pHistory)
        {
            if (eType == pHistory.m_eFrom)
            {
                return(true);
            }
        }

        return(false);
    }
Exemplo n.º 21
0
    // 유틸 : 씬 변경이 시작될때 알려달라고 한 곳에 알려주자
    void SendCallback(eSceneType eCurrent, eSceneType eChange)
    {
        SHUtils.ForToList(m_pEventToChangeScene, (pAction) =>
        {
            if (null == pAction)
            {
                return;
            }

            pAction(eCurrent, eChange);
        });
    }
Exemplo n.º 22
0
    void Update()
    {
        if (Operation != null)
        {
            StackTime += Time.deltaTime;

            UI_Tools.Instance.ShowLoadingUI(Operation.progress);

            if (Operation.isDone == true)
            {
                CurrentState = NextState;
                ComplateLoad(CurrentState);

                Operation = null;
                NextState = eSceneType.SCENE_NONE;

                // Loding UI 삭제
                UI_Tools.Instance.HideUI(eUIType.PF_UI_LOADING, true);
            }
            else
            {
                return;
            }
        }

        if (CurrentState == eSceneType.SCENE_NONE)
        {
            return;
        }

        if (NextState != eSceneType.SCENE_NONE &&
            CurrentState != NextState)
        {
            DisableScene(CurrentState);

            if (IsAsyc)
            {            // 비동기 로드
                Operation = SceneManager.LoadSceneAsync(NextState.ToString("F"));
                StackTime = 0f;

                UI_Tools.Instance.ShowLoadingUI(0.0f);
            }
            else
            {
                SceneManager.LoadScene(NextState.ToString("F"));
                CurrentState = NextState;
                NextState    = eSceneType.SCENE_NONE;
                ComplateLoad(CurrentState);
            }
        }
    }
Exemplo n.º 23
0
    public List <string> GetData(eSceneType eType)
    {
        if (false == IsLoadTable())
        {
            LoadJson((errorCode) => {});
        }

        if (false == m_pData.ContainsKey(eType))
        {
            return(new List <string>());
        }

        return(m_pData[eType]);
    }
Exemplo n.º 24
0
 // 유틸 : 씬 이동 실행
 void ExcuteGoTo(eSceneType eType)
 {
     PlayFadeIn(() =>
     {
         if (true == IsNeedLoading(eType))
         {
             LoadScene(eSceneType.Loading, (bIsSuccess) => PlayFadeOut(null));
         }
         else
         {
             LoadScene(eType, (bIsSuccess) => PlayFadeOut(null));
         }
     });
 }
Exemplo n.º 25
0
    // 다양화 : 로드할 데이터 리스트 알려주기
    public override Dictionary <string, SHLoadData> GetLoadList(eSceneType eType)
    {
        var dicLoadList = new Dictionary <string, SHLoadData>();

        SHUtils.ForToList(Single.Table.GetPreLoadResourcesList(eType), (pValue) =>
        {
            if (true == IsLoadResource(pValue))
            {
                return;
            }

            dicLoadList.Add(pValue, CreateLoadInfo(pValue));
        });

        return(dicLoadList);
    }
Exemplo n.º 26
0
    public void OnEventToChangeScene(eSceneType eCurrentScene, eSceneType eNextScene)
    {
        var pDestroyPanels = new DicPanels();

        SHUtils.ForToDic(m_dicPanels, (pKey, pValue) =>
        {
            if (eObjectDestoryType.ChangeScene != pValue.m_eDestroyType)
            {
                return;
            }

            pDestroyPanels.Add(pKey, pValue);
        });

        DestoryPanel(pDestroyPanels);
    }
Exemplo n.º 27
0
    public void Load(eSceneType eType, Action <SHLoadingInfo> pDone, Action <SHLoadingInfo> pProgress)
    {
        OnEventToLoadStart();

        GetLoadList(eType, (pLoadList) =>
        {
            m_pLoader.Process(pLoadList, (pLoadInfo) =>
            {
                if (null != pDone)
                {
                    pDone(pLoadInfo);
                }

                OnEventToLoadDone();
            }, pProgress);
        });
    }
Exemplo n.º 28
0
    public CutSceneInfo(XmlNode node)
    {
        XmlAttribute scene_type_attr = node.Attributes["scene_type"];

        if (scene_type_attr != null)
        {
            SceneType   = (eSceneType)Enum.Parse(typeof(eSceneType), scene_type_attr.Value);
            map_id      = node.Attributes["map_id"].Value;
            stage_index = int.Parse(node.Attributes["stage_index"].Value);

            StageInfo = MapInfoManager.Instance.GetInfoByID(map_id).Stages[stage_index].Difficulty[0];
        }
        else
        {
            SceneType = eSceneType.None;
        }
    }
Exemplo n.º 29
0
        public BaseScene GetScene(ushort scene_type)
        {
            BaseScene  _scene = null;
            eSceneType type   = SceneID.GetSceneTypeByID(scene_type);

            if (type == eSceneType.CITY)
            {
                if (m_city_scenes.TryGetValue(scene_type, out _scene))
                {
                    return(_scene);
                }
                return(null);
            }
            else if (type == eSceneType.BATTLE)
            {
                return(null);
            }
            return(null);
        }
Exemplo n.º 30
0
    public override Dictionary <string, SHLoadData> GetLoadList(eSceneType eType)
    {
        var dicLoadList = new Dictionary <string, SHLoadData>();

        // 로컬 테이블 데이터
        SHUtils.ForToDic <Type, SHBaseTable>(m_dicTables,
                                             (pKey, pValue) =>
        {
            // 이미 로드된 데이터인지 체크
            if (true == pValue.IsLoadTable())
            {
                return;
            }

            dicLoadList.Add(pValue.m_strFileName, CreateLoadInfo(pValue.m_strFileName));
        });

        return(dicLoadList);
    }
Exemplo n.º 31
0
 public void SetCurrentScene(eSceneType sceneType)
 {
     m_currentScene = sceneType;
 }
Exemplo n.º 32
0
	//this loads the specified scene type
	public static void LoadScene( eSceneType pType )
	{
		if( mBeforeLoad != null )
			mBeforeLoad( mCurrentScene, 0);
		
		string level2Load = "";
		switch( pType )
		{
		case eSceneType.Level:
			if( mCurrentLevelIndex < mCurrent.mLevelScene.Length )
			{
				level2Load =  mCurrent.mLevelScene[ mCurrentLevelIndex];
				
			}
#if UNITY_EDITOR
			else{
				Debug.LogError("GAMECONTROLLER: unable to load the level with index of " + mCurrentLevelIndex);
			}
#endif
			break;
			
		case eSceneType.Menu:
			level2Load = mCurrent.mMenuScene;
			break;
		}
		
		Application.LoadLevel( level2Load );
	}