Esempio n. 1
0
        public void Load(string _strPath)
        {
            m_FilePath        = ViewConfigManager.GetAccountConfigFullPath("TaskViewTimeConfig.csv");
            m_mapTaskViewTime = new Dictionary <long, int>();

            LoadTaskViewTimeConfig(m_FilePath);
        }
Esempio n. 2
0
    /// <summary>
    /// 加载声音配置
    /// </summary>
    private static bool LoadSoundConfig(ref Dictionary <int, SoundConfigData> dataSet)
    {
        if (dataSet == null)
        {
            SoundSystemLog("参数dataset为null");
            return(false);
        }

        string patch = ViewConfigManager.GetConfigFullPath(ConfigFileName);

        ScpReader SoundReader = new ScpReader(patch, true, 2);

        // 遍歷整個表并存儲起來
        for (int i = 0; i < SoundReader.GetRecordCount(); ++i)
        {
            SoundConfigData data = new SoundConfigData();
            data.nID                       = SoundReader.GetInt(i, (int)SoundConfigCol.COL_ID, 0);
            data.soundType                 = (EMSoundType)SoundReader.GetInt(i, (int)SoundConfigCol.COL_Type, 2);
            data.mixerGroupType            = (AudioMixerGroupType)SoundReader.GetInt(i, (int)SoundConfigCol.COL_MixerGroupType, 1);
            data.nMixerGroupIndex          = SoundReader.GetInt(i, (int)SoundConfigCol.COL_MixerGroupIndex, 0);
            data.bBypassEffect             = SoundReader.GetInt(i, (int)SoundConfigCol.COL_BypassEffect, 0) > 0;
            data.bBypassReverbZone         = SoundReader.GetInt(i, (int)SoundConfigCol.COL_BypassReverbZone, 0) > 0;
            data.bPlayOnAwake              = SoundReader.GetInt(i, (int)SoundConfigCol.COL_PlayOnAwake, 1) > 0;
            data.nPriority                 = Mathf.Clamp(SoundReader.GetInt(i, (int)SoundConfigCol.COL_Priority, 128), 0, 256);
            data.fPitch                    = Mathf.Clamp(SoundReader.GetFloat(i, (int)SoundConfigCol.COL_Pitch, 1), -3.0f, 3.0f);
            data.fStereoPan                = Mathf.Clamp(SoundReader.GetFloat(i, (int)SoundConfigCol.COL_StereoPan, 0), -1.0f, 1.0f);
            data.fReverZoneMix             = Mathf.Clamp(SoundReader.GetFloat(i, (int)SoundConfigCol.COL_ReverZoneMix, 1), 0, 1.1f);
            data.b3DSound                  = SoundReader.GetInt(i, (int)SoundConfigCol.COL_3DSound, 1) > 0;
            data.fDopplerLv                = Mathf.Clamp(SoundReader.GetFloat(i, (int)SoundConfigCol.COL_DopplerLv, 1), 0, 5.0f);
            data.nSpread                   = Mathf.Clamp(SoundReader.GetInt(i, (int)SoundConfigCol.COL_Spread, 0), 0, 360);;
            data.audioRoffType             = (AudioRolloffMode)SoundReader.GetInt(i, (int)SoundConfigCol.COL_RolloffMode, 0);
            data.fMinDistance              = SoundReader.GetFloat(i, (int)SoundConfigCol.COL_MinDistance, 1);
            data.fMaxDistance              = SoundReader.GetFloat(i, (int)SoundConfigCol.COL_MaxDistance, 15);
            data.nPlayTimes                = SoundReader.GetInt(i, (int)SoundConfigCol.COL_PlayTimes, 1);
            data.fDuartion                 = SoundReader.GetFloat(i, (int)SoundConfigCol.COL_Duartion, 0);
            data.fDelayPlayTime            = SoundReader.GetFloat(i, (int)SoundConfigCol.COL_DelayTime, 0);
            data.fIntervalBetweenPlayTimes = SoundReader.GetFloat(i, (int)SoundConfigCol.COL_IntervalBetweenPlayTimes, 0);
            data.AssetBundleName           = SoundReader.GetString(i, (int)SoundConfigCol.COL_AssetBundleName, "");
            data.AssetName                 = SoundReader.GetString(i, (int)SoundConfigCol.COL_AssetName, "");
            data.AssetGUID                 = SoundReader.GetString(i, (int)SoundConfigCol.COL_AssetGUID, "");
            data.AssetSize_X               = SoundReader.GetFloat(i, (int)SoundConfigCol.COL_AssetSize_X, -1);
            data.AssetSize_Y               = SoundReader.GetFloat(i, (int)SoundConfigCol.COL_AssetSize_Y, -1);
            data.szDependAssetGUID         = SoundReader.GetString(i, (int)SoundConfigCol.COL_DependAssetGUID, "");
            if (dataSet.ContainsKey(data.nID))
            {
                SoundSystemLog(ConfigFileName + "拥有重复的ID!");
                dataSet[data.nID] = data;
            }
            else
            {
                CheckConfig(data);
                dataSet.Add(data.nID, data);
            }
        }
        SoundReader.Dispose();
        SoundReader = null;
        return(true);
    }
Esempio n. 3
0
        public override bool Init(IUISubWnd wnd)
        {
            base.Init(wnd);

            EntityView curHeroView = EntityFactory.MainHeroView;

            InitSpellSlotConfigCsv(ViewConfigManager.GetConfigFullPath("SpellSlot.csv", true));
            //SettingKeyCodeInfo(curHeroView);

            return(true);
        }
    public override void OnEnter()
    {
        PlayerSettingLocalConfig.Instance.Load(ViewConfigManager.GetConfigFullPath("PlayerLocalSetting.csv", false));

        ImageSetting.Init();

        PerformanceCheckManager.Instance.flowShareData.oldAsyncCout   = QualitySettings.vSyncCount;
        PerformanceCheckManager.Instance.flowShareData.oldTargetFrame = Application.targetFrameRate;

        QualitySettings.vSyncCount = 0;

        ImageSetting.SetResolution(ImageSetting.systemResolutions, true, true);
        PerformanceCheckManager.Instance.flowShareData.currentCheckTime = PerformanceCheckManager.HoldDuringCheckTime;
        PerformanceCheckManager.Instance.flowShareData.StartCheckTimer  = true;
        PerformanceCheckManager.Instance.flowShareData.CheckUI.OnUpdate();
    }
Esempio n. 5
0
    public void OnDestroy()
    {
        isOnGameRuning      = false;
        OnDeviceStateChage -= OnDeviceStateChange;
        OnDeviceStateChage  = null;
        mainCam             = null;
        Effect.EffectNode.ClearTargetCache();
        ViewConfigManager.Destroy();
        RenderViewAPI.Stop();
        GameLogicAPI.Stop();

        SceneManager.UnRegisterSceneLoadFinishEvent(SceneLoadFinish);

        MouseCursorManager.Instance.DestroyMouseCursroManager();
        FuntionShortCutCtrl.Destroy();
        GUIDE.GuideManager.Destroy();
        SceneEffectManager.Destroy();
    }
Esempio n. 6
0
    private void onLeaveBattleState()
    {
        //Debug.Log("Leave Battle State...");

        CurPermissionState = EStage_PermissionState.ESPS_NORMAL;

        USpeedUI.Blood.UBloodManager.Instance.DestroyALL();

        UTopNameManager.Instance.PreWarmTopName();

        ViewConfigManager.UnLoadMobaConfigs();

        LogicDataCenter.onLeaveBattleState();

        InputManager.Available = true;

        SoundManager.DeleteAll();

        UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE, null);
    }
Esempio n. 7
0
    void ExportInfo()
    {
        PerformanceCheckManager.PerformanceCheckReslut result = PerformanceCheckManager.Instance.ReslutData;
        string path = ViewConfigManager.GetConfigFullPath(PerformanceCheckManager.confingFileName, false);

        System.IO.StreamWriter writer = new System.IO.StreamWriter(path, false, new System.Text.UTF8Encoding(true));


        string s = "";

        s = "PerformanceCheckVersion" + "," + PerformanceCheckManager.currPerformanceCheckVersion;
        writer.WriteLine(s);

        s = "Fps" + "," + PerformanceCheck_FPS.currFPS;
        writer.WriteLine(s);

        s = "NotDoPerformanceCheck" + "," + result.NotDoPerformanceCheck;
        writer.WriteLine(s);

        s = "VeryLowMachine" + "," + result.VeryLowMachine;
        writer.WriteLine(s);

        s = "notSupportRT" + "," + result.notSupportRT;
        writer.WriteLine(s);

        s = "notSupportHighLevel" + "," + result.notSupportHighLevel;
        writer.WriteLine(s);

        s = "GeometricRenderLevel" + "," + result.GeometricRenderLevel;
        writer.WriteLine(s);

        s = "ImageEffectRenderLevel" + "," + result.ImageEffectRenderLevel;
        writer.WriteLine(s);

        s = "ReslutImageFlags" + "," + flag;
        writer.WriteLine(s);

        writer.Flush();
        writer.Close();
        writer = null;
    }
Esempio n. 8
0
    private int GetPerformanceCheckVersion()
    {
        int    version             = -1;
        string confingFileNamePath = ViewConfigManager.GetConfigFullPath(PerformanceCheckManager.confingFileName, false);

        if (!System.IO.File.Exists(confingFileNamePath))
        {
            return(version);
        }

        string stSchemeAllText = System.IO.File.ReadAllText(confingFileNamePath);

        //去掉\n,因为ScpReader以"\r"分割
        stSchemeAllText = stSchemeAllText.Replace("\n", "");
        //再干掉最后的"\r"
        stSchemeAllText = stSchemeAllText.Remove(stSchemeAllText.Length - 1, 0);
        ScpReader packageReader = new ScpReader(stSchemeAllText, "per", 0);

        version = packageReader.GetInt(0, 1, -1);

        return(version);
    }
Esempio n. 9
0
 public void AccountLoad()
 {
     m_FilePath = ViewConfigManager.GetAccountConfigFullPath("PlayerLocalHeroConfig.csv");
     InitPlayerLocalHeroCsv(ref m_SkinDataMap, m_FilePath, false);
 }
Esempio n. 10
0
 public void Load(string stPath)
 {
     InitPlayerLocalHeroCsv(ref m_SkinScpDataMap, ViewConfigManager.GetConfigFullPath("PlayerLocalHeroConfig.csv", true), true);
 }
Esempio n. 11
0
 public void Load(string strPath)
 {
     _LoadGuideNodeConfig(ViewConfigManager.GetConfigFullPath("GuideConfig.csv"));
     _LoadGuideStateConfig(ViewConfigManager.GetConfigFullPath("GuideStateConfig.csv"));
 }
Esempio n. 12
0
    /// <summary>
    /// 创建通用逻辑模块,主场景和战斗场景均使用,依赖配置表,通常情况下需要更新资源后再执行
    /// </summary>
    public IEnumerator CreateEnumerator()
    {
        bCreated = false;

        Type[] types = new Type[]
        {
            typeof(AssetSystem),
            typeof(ShaderLib),
            typeof(SceneManager),
            typeof(NatureManager),
            typeof(WarFogManager),
        };

        CreateModulesAsyn(types);

        //wait another coroutine finish
        while (true)
        {
            yield return(new WaitForEndOfFrame());

            bool bOK = (CreatingModules.Count == 0);
            if (bOK)
            {
                break;
            }
        }

        yield return(new WaitForSeconds(0.1f));

        if (!Application.isEditor && System.IO.File.Exists("BreakPoint.txt"))
        {
            GameUtil.MsgBox(m_WindowHwnd, "挂断点", "调试", 0);
        }

        if (!RenderViewAPI.Start())
        {
            Trace.LogError("Game Start Service failure");
            yield break;
        }
        Trace.Log("Game Start Service successed");
        // 初始化
        gameObject.AddComponent <GameViewCommandHandler>();

        OnDeviceStateChage += OnDeviceStateChange;

        // 初始化游戏接口
        IntPtrHelper helper = new IntPtrHelper();

        //GameLogicAPI.Start(ASpeedGame.Data.GameSettingsXml.GameSettingsXmlManager.Instance.GameSettingsModel.enableMultiThread.AValue,
        //    helper.toPtr(ref RenderViewAPI.g_RenderView));
        GameLogicAPI.Start(helper.toPtr(ref RenderViewAPI.g_RenderView));
        yield return(new WaitForSeconds(1.0f));

        PrintTickCheck("初始化逻辑层API,至少等了1秒", CostThreshold_Lv1, _bStart: true);

        // 显示层配置价值
        ViewConfigManager.Init();
        PrintTickCheck("ViewConfigManager.Init");


        //资源是要配置初始化
        AssetBundleManager.Init();
        PrintTickCheck("AssetBundleManager.Init");



        LogicDataCenter.Init();
        PrintTickCheck("LogicDataCenter.Init");



        ImageSetting.Init();
        PrintTickCheck("ImageSetting.Init");

        ImageEffectManager.API_GameStart();
        PrintTickCheck("ImageEffectManager.Init");

        //GameViewCommandHandler.Instance.Start();
        MouseCursorManager.Instance.InitMouseCursorManager();
        PrintTickCheck("MouseCursorManager.Init");

        // 初始化实体接口,依赖上面的物件管理器所以顺序不能换
        EntityFactory.Init();
        PrintTickCheck("EntityFactory.Init");


        PrefabManager.Init();
        PrintTickCheck("PrefabManager.Init");


        SkinManager.Init();
        PrintTickCheck("SkinManager.Init");



        SoundManager.Init();
        PrintTickCheck("SoundManager.Init");

        UISystem.Init();
        PrintTickCheck("UISystem.Init");

        UTopNameManager.Init();
        PrintTickCheck("UTopNameManager.Init");

        USpeedUI.Blood.UBloodManager.Init();
        PrintTickCheck("UBloodManager.Init");



        InputManager.Init();
        PrintTickCheck("InputManager.Init");



        Effect.EffectNode.InitTargetCache();
        PrintTickCheck("Effect.EffectNode.InitTargetCache.Init");

        GUIDE.GuideManager.Init();
        PrintTickCheck(" GUIDE.GuideManager.Init");

        SceneEffectManager.Init();
        PrintTickCheck("SceneEffectManager.Init");
        if (LightingEffectFactory.Instance)
        {
            LightingEffectFactory.Instance.InitWhenGameStart();
        }
        PrintTickCheck("LightingEffectFactory.Init");

        SafeZoneEffectManager.Init();
        PrintTickCheck("SafeZoneEffectManager.Init");

        ImageSetting.TraceSettings();

        bCreated = true;

        List <string> argList = new List <string>();

        argList.AddRange(System.Environment.GetCommandLineArgs());

        CkeckUpdateOk(ref argList);
        PrintTickCheck("CkeckUpdateOk");

        CheckMultclient();
        PrintTickCheck("CheckMultclient");

        StageManager.Init();
        AssetBundleManager.DeleteAssets(ref LoadingWaitngResNode, true);
    }
Esempio n. 13
0
    public void Start()
    {
        if (!CheckMultclient())
        {
            Application.Quit();
            return;
        }

        if (!CkeckUpdateOk())
        {
            Application.Quit();
            return;
        }
        Instance = this;
        Initialize.m_WindowHwnd = GameLogicAPI.getMainWindHwnd();
        AssetBundleManager.Init();


        UIResNode = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "f8aafccc7fff6e34490e09b186458dd8", true);

        if (ResNode.isNullOrEmpty(UIResNode))
        {
            Debug.LogError("找不到性能检测UI资源,以最低配置运行");
            if (AssetBundleManager.isCanLoadLevel(LoginSceneName))
            {
                AssetBundleManager.LoadLevel(LoginSceneName);
            }


            return;
        }
        flowShareData.CheckUI = UIResNode.InstanceMainRes <PerformanceCheck_UI>();
        if (!flowShareData.CheckUI)
        {
            Debug.LogError("找不到性能检测UI,以最低配置运行");
            if (AssetBundleManager.isCanLoadLevel(LoginSceneName))
            {
                AssetBundleManager.LoadLevel(LoginSceneName);
            }
            return;
        }

        ImageEffects.ImageEffectManager.API_ResetSceneBrightness();

        FlowTable.Add(CheckFlow.HardWareSupport, new PerformanceCheckFlow_HardWareSupport());
        FlowTable.Add(CheckFlow.GeometricRender, new PerformanceCheckFlow_RenderingLevel());
        FlowTable.Add(CheckFlow.Finish, new PerformanceCheckFlow_Finish());
        ViewConfigManager.SetDefaultViewConfigPath();

        if (flowShareData.CheckUI)
        {
            flowShareData.CheckUI.Init();
        }

        //本地已经有这个配置了,直接进游戏
        if (GetPerformanceCheckVersion() == currPerformanceCheckVersion)
        {
            if (AssetBundleManager.isCanLoadLevel(LoginSceneName))
            {
                AssetBundleManager.LoadLevel(LoginSceneName);
            }
        }
        else
        {
            InitData();
            if (flowShareData.CheckUI)
            {
                flowShareData.CheckUI.StartCheck();
            }

            ChangeFlow(CheckFlow.HardWareSupport);
            StartCoroutine(RunPerformanceCheck());
        }
    }