示例#1
0
    public void Awake()
    {
        isOnGameRuning = true;
        m_WindowHwnd   = GameLogicAPI.getMainWindHwnd();
        if (!Application.isEditor)
        {
            GameLogicAPI.SetWindowText(Initialize.m_WindowHwnd, "泰坦-大地之子,勇往直前");
        }

        InitDoTween();
        GameLogicAPI.OpenLog();

        if (AssetBundleManager.isVaild)
        {
            LoadingWaitngResNode = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "fa32d80346317d445bf6bdd4f1b4c5da", true);
            if (!ResNode.isNullOrEmpty(LoadingWaitngResNode))
            {
                LoadingWaitngResNode.InstanceMainRes();
            }
        }

        DontDestroyOnLoad(gameObject);

        Type[] types = new Type[]
        {
            typeof(Trace),
        };
        CreateModulesSync(types);

        if (Time.timeScale < 0.01)
        {
            Time.timeScale = 1f;
        }

        mainCam       = Camera.main;
        Instance      = this;
        myTransform   = this.transform;
        SoliderTarget = myTransform.FindChild("SoldierTarget").gameObject;
        Hero_Camera   = Initialize.mainCam.gameObject;
        TargetFrame   = myTransform.FindChild("TargetFrame").gameObject;
        Second_Camera = myTransform.FindChild("Second_Camera").gameObject;
        SecondTarget  = Second_Camera.transform.FindChild("SecondTarget").gameObject;
        CamInitPos    = Hero_Camera.transform.position;
        CamInitQua    = Hero_Camera.transform.rotation;
        SetState(InitializeState.Init);

        SceneManager.RegisterSceneLoadFinishEvent(SceneLoadFinish);
        SceneManager.RegisterSceneLoadStartEvent(SceneLoadStart);

        SceneResInfoManager.RegisterActiveSceneChangedEvent(ActiveSceneChanged);

        UISystem.OnResolutionChanged += DoMouseLockInModeType;

        //将显示层配置文档初始化提前避免启用多线程时配置文档未初始化
        //ViewConfigManager.Init();
    }
示例#2
0
    public static void Init()
    {
        //InitUGUI();

        if (bInit)
        {
            return;
        }
        bInit = true;
        //如果加载配置失败,则使用默认的配置
        bool bLoadConfig = LoadConfig();

        if (!MonoInstance)
        {
            MonoInstance = new GameObject();
            MonoInstance.AddComponent <ImageSetting>().hideFlags = HideFlags.NotEditable;
            MonoInstance.name = "ImageSetting";
            DontDestroyOnLoad(MonoInstance);
        }
        InitResolution();

        //有开启自动调整,参数设置为预设的值
        if (bLoadConfig /*&& AutoAdjustQuality > 0*/)
        {
            SetImageQuality(currData.currImageQuality);
        }
        else
        {
            //加载配置失败就使用默认配置
            if (bLoadConfig)
            {
                //没有开启自动调整,直接应用参数,采用玩家的值
                Apply(true);
            }
            else
            {
                SetDefaultSetting();
            }
        }

        ImageEffects.ImageEffectManager.AdvanceImangeEffectEnabled = currData.AdvanceImageEffectEnabled == 1;
        //ApplyUIData();
        GameFrameManager.FpsMonitor.SubScribeProfileEvent(OnFPSChange);
        SceneResInfoManager.RegisterActiveSceneChangedEvent(ActiveSceneChaned);
        SceneResInfoManager.RegsiterGetImageSettignData(GetData);
    }