/// <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);
        }
示例#2
0
    protected override void OnLeave(ProcedureOwner procedureOwner, bool isShutdown)
    {
        m_Scene.Exit();
        m_Scene = null;

        base.OnLeave(procedureOwner, isShutdown);
    }
示例#3
0
    override public BaseScene CreateScene(int resId)
    {
        BaseScene scene = new CityScene();

        if (!InitScene(scene, resId))
        {
            return(null);
        }

        return(scene);
    }
示例#4
0
    protected override void OnEnter(ProcedureOwner procedureOwner)
    {
        base.OnEnter(procedureOwner);

        int sceneId = procedureOwner.GetData <VarInt>(Const.ProcedureDataKey.NextSceneId).Value;

        m_Scene = new CityScene(sceneId);
        m_Scene.Enter();

        //GameManager.UI.OpenUIForm(UIFormId.MenuForm);
    }
示例#5
0
        private static SceneBase getSceneBaseByType(SceneType type, object arg = null)
        {
            switch (type)
            {
            case SceneType.City:
                return(CityScene.Create(arg));

            case SceneType.Login:
                return(LoginScene.Create(arg));
            }
            Debug.LogError("getSceneBaseByType is null " + type.ToString());
            return(null);
        }