Example #1
0
 public static void LoadCameraData(string path, System.Action <bool> fn = null)
 {
     if (!_current_camera.Equals(path))
     {
         mInitializeCameras.TryGetValue(path, out _instance);
         EB.Assets.LoadAsync(path, typeof(GlobalCameraData), o =>
         {
             if (o)
             {
                 _instance = o as GlobalCameraData;
                 mInitializeCameras[path] = _instance;
                 _current_camera          = path;
                 if (fn != null)
                 {
                     fn(true);
                 }
             }
         });
     }
     else
     {
         if (fn != null)
         {
             fn(true);
         }
     }
 }
Example #2
0
    protected override void OnComponentStart()
    {
        base.OnComponentStart();
#if UNITY_EDITOR
        GlobalCameraData.LoadCameraData(GlobalCameraData.COMBAT_VIEW_CAMERA);
#endif
        InitializeWaypoints();
        transform.position = m_waypoints[0];

        if (m_lookat_locator != null)
        {
            transform.LookAt(m_lookat_locator.transform.position);
            _gameCamera.SetGameCameraPositionAndRotation(m_lookat_locator.transform.position, this);
            _gameCamera.GetPosition(ref _gameCameraPosition);
            _gameCamera.GetRotation(ref _gameCameraRotation);
            //transform.position = _gameCameraPosition;
            //transform.rotation = _gameCameraRotation;
        }

        State               = MotionState.Idle;//由于此处写明当Start的时候直接是从Invalid变为Idle 可视为默认应该是idle状态
        m_origin_pos        = transform.position;
        m_origin_angle      = transform.eulerAngles;
        _gameCameraPosition = transform.position;
        _gameCameraRotation = transform.rotation;

        DisableBlurEffect();
        m_initialized = true;
    }
Example #3
0
    protected override void OnComponentStart()
    {
#if UNITY_EDITOR
        GlobalCameraData.LoadCameraData(GlobalCameraData.CAMPAIGN_VIEW_CAMERA);
#endif
        base.OnComponentStart();
        ViewMode = eViewMode.Normal;
    }
Example #4
0
 protected override void InitializeCamera()
 {
     base.InitializeCamera();
     GlobalCameraData.LoadCameraData(GlobalCameraData.COMBAT_VIEW_CAMERA);
 }
Example #5
0
        public override IEnumerator Start()
        {
            GameStateDownload.LogWithTime("LTGameStateLogin.Start=====>");
            if (ILRDefine.IS_FX)
            {
                if (!GameEngine.Instance.TextureDic.ContainsKey(GameEngine.Instance.LoginBGPath))
                {
                    yield return(GameEngine.Instance.SetStreamingAssetsBG(GameEngine.Instance.LoginBGPath));
                }
                if (!GameEngine.Instance.TextureDic.ContainsKey(GameEngine.Instance.BrandPath))
                {
                    yield return(GameEngine.Instance.SetStreamingAssetsBG(GameEngine.Instance.BrandPath));
                }
            }
            else if (Application.identifier.Equals("com.mkhx.xinkuai"))
            {
                if (!GameEngine.Instance.TextureDic.ContainsKey(GameEngine.Instance.BrandPath))
                {
                    yield return(GameEngine.Instance.SetStreamingAssetsBG(GameEngine.Instance.BrandPath));
                }
            }

            // wait network available
            #region wait network available
            while (Application.internetReachability == NetworkReachability.NotReachable)
            {
                yield return(GameEngine.Instance.StartCoroutine(ShowLoadingScreen()));

                yield return(GameEngine.Instance.StartCoroutine(ShowNetworkRetryDialog()));
            }
            #endregion

            // load LoginUI
            yield return(GameEngine.Instance.StartCoroutine(LoadLoginUI()));

            UIStack.Instance.ForceHideLoadingScreen();
            LoadingSpinner.Destroy();

            GameObject obj = GameObject.Find("DownloadHudUI");
            if (obj != null)
            {
                GameObject.Destroy(obj);
            }

            //清除表数据
            ClientDataUtil.OnResetTemplateManager();
            //清datalookup缓存
            DataLookupsCache.Instance.ClearCache();

            GameEngine.Instance.LoginListener.ResolveMHLoginEvent += OnResolveMHLoginEvent;
            GameEngine.Instance.LoginListener.LoginEvent          += OnLogin;
            GameEngine.Instance.LoginListener.LoginFailedEvent    += OnLoginFailed;
            GameEngine.Instance.LoginListener.UpdateEvent         += OnUpdateRequired;

            LoginManager.Instance.LoginExtraListener.ResolveAuthenticatorsEvent         += OnResolveAuthenticators;
            LoginManager.Instance.LoginExtraListener.ResolveMultipleAuthenticatorsEvent += OnResolveMultipleAuthenticators;
            LoginManager.Instance.LoginExtraListener.AuthorizedEvent += OnAuthorized;

            LoginManager.Instance.Api.ErrorHandler += OnApiError;

            //设置音效
            AudioManager.Initialize();
            //预加载主场景摄像机
            GlobalCameraData.LoadCameraData(GlobalCameraData.CAMPAIGN_VIEW_CAMERA);

            yield return(new WaitForSeconds(0.2f));//等待小段时间防止花屏

            Enumerate();

            GameStateDownload.LogWithTime("<=====LTGameStateLogin.Start");
        }