示例#1
0
        //刷新档案红点数据
        public void ReflashArchivesRedPoint()
        {
            int redPointCount = 0;

            if (PlayerPrefTool.GetIsThereNewChapterNPC())
            {
                OnNewChapterTypeNotify(0);
                redPointCount++;
            }

            if (PlayerPrefTool.GetIsThereNewChapterClue())
            {
                OnNewChapterTypeNotify(1);
                redPointCount++;
            }

            if (PlayerPrefTool.GetIsThereNewChapterScene())
            {
                OnNewChapterTypeNotify(2);
                redPointCount++;
            }
            if (redPointCount == 0)
            {
                GameEvents.RedPointEvents.User_OnNewChapterBannerEvent.SafeInvoke(false); //
            }
        }
示例#2
0
        /// <summary>
        /// 预初始化引擎层
        /// </summary>
        private void PreInitEngine()
        {
            LogReporter.InitLogReporter();
            ReflectionHelper.InitAssembly();
            Utf8Json.Resolvers.CompositeResolver.RegisterAndSetAsDefault(new[] { PrimitiveObjectFormatter.Default }, new[] { Utf8Json.Resolvers.GeneratedResolver.Instance, Utf8Json.Resolvers.BuiltinResolver.Instance });

            EngineCoreEvents.SystemEvents.OnEngineReady           += OnEngineReady;
            EngineCoreEvents.BridgeEvent.GetGameRootObject         = () => { return(gameObject); };
            EngineCoreEvents.BridgeEvent.GetGameRootBehaviour      = () => { return(this); };
            EngineCoreEvents.BridgeEvent.StartCoroutine            = (coroutine) => StartCoroutine(coroutine);
            EngineCore.EngineDelegateCore.GameClientEntrySceneName = "GameClient";
            EngineDelegateCore.AudioRootGameObject = transform.Find("AudioObject").gameObject;

            EngineCore.EngineDelegateCore.DefaultBGMMixerGroup    = this.m_BGMAudioMixerGroup;
            EngineCore.EngineDelegateCore.DefaultEffectMixerGroup = this.m_soundAudioMixerGroup;

            //开关,是否在编辑器下模拟对应的平台
            EngineCore.EngineDelegateCore.Editor_Simulate_Player = false;

#if UNITY_ANDROID || UNITY_IOS
            if (!string.IsNullOrEmpty(GameConst.MARKET_FLAG))
            {
                EngineDelegateCore.DynamicResource = true;
            }
#endif
            EngineCore.EngineDelegateCore.IsFirstTimeLaunch = PlayerPrefTool.HasKey(ENUM_PREF_KEY.E_FIRST_TIME_LAUNCH.ToString());
        }
示例#3
0
        private static bool BindGuestToFacebook()
        {
            if (null != PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_GUEST))
            {
                Debug.Log("FACEBOOK : BindGuestToFacebook");

                CSFBBindRequest req = new CSFBBindRequest();
                req.Identify = PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_GUEST);

#if UNITY_EDITOR || TEST
                req.AccessToken = test_token;
                req.FbId        = test_id;
                req.ExpiresIn   = test_expire_time;
#else
                req.AccessToken = AccessToken.CurrentAccessToken.TokenString;
                req.FbId        = AccessToken.CurrentAccessToken.UserId;
                req.ExpiresIn   = AccessToken.CurrentAccessToken.ExpirationTime.TotalSeconds();
#endif
                //GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
                GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
                DebugUtil.Log("send CSFBBindRequest");
                return(true);
            }

            return(false);
        }
        public override void OnShow(object param)
        {
            base.OnShow(param);
            m_is_start_timer        = false;
            m_cur_time              = 0.0f;
            is_token_checked        = false;
            GlobalInfo.GAME_NETMODE = GameNetworkMode.Network;
            CommonHelper.ShowLoading(false);

            m_login_btn.AddClickCallBack(OnNormalVersionClicked);
            m_fackbook_btn.AddClickCallBack(OnFBVersionClicked);

            MessageHandler.RegisterMessageHandler(MessageDefine.SCRegGuestResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCIdentifyCheckRepsonse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCPlayerInfoResponse, OnScResponse);
            //MessageHandler.RegisterMessageHandler(MessageDefine.SCPlayerPropResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCFBLoginResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCFBBindResponse, OnScResponse);
            //MessageHandler.RegisterMessageHandler(MessageDefine.SCNoticeListResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCPlayerGuildResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCGetPushResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCIdentifyCheckMuiltyMessage, OnScResponse);

            this.m_contentLab.Text = LocalizeModule.Instance.GetString("guide_0_05");


            GameEvents.UIEvents.UI_FB_Event.Listen_FbLoginStatusChanged += SetFBBtnIcon;

            if (null != PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD))
            {
                SwitchBtns(ENUM_BTN_TYPE.E_NO_THIRD);
            }
            else
            {
                SwitchBtns(ENUM_BTN_TYPE.E_ALL);
            }

            if (null != param)
            {
                SwitchBtns(ENUM_BTN_TYPE.E_ALL);

                if (ENUM_ACCOUNT_TYPE.E_GUEST == (ENUM_ACCOUNT_TYPE)(param))
                {
                    LoginUtil.OnAccountChangeToGuest();
                    Debug.LogWarning($"FB : GO TO GUEST IN LOGIN third name is {PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD)} , logined { FB.IsLoggedIn}");
                    IntervalSetFBBtnIcon(true);
                    //PregameUILogic.instance.Destory();
                    return;
                }
                else
                {
                    LoginUtil.OnAccountNativeLogin((ENUM_ACCOUNT_TYPE)(param));
                }
            }

            SetFBBtnIcon();
            //PregameUILogic.instance.Destory();
            LocalDataManager.Instance.Is_login = true;
        }
示例#5
0
        private void OnNewNoticeNotify(object msg)
        {
            PlayerPrefTool.SetIsThereNewNotice(true);

            if (!GameEvents.RedPointEvents.User_OnNewNoticeEvent.IsNull)
            {
                GameEvents.RedPointEvents.User_OnNewNoticeEvent.SafeInvoke();
            }
        }
示例#6
0
 public static void RegisterGuest()
 {
     //偷偷的注册一下
     if (null == PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_GUEST))
     {
         MessageHandler.RegisterMessageHandler(MessageDefine.SCRegGuestResponse, OnScResponse);
         LoginUtil.RequestRegisterGuest();
     }
 }
示例#7
0
 public PlayerInfo SetIcon(string playerIcon_)
 {
     this.m_playerIcon = playerIcon_;
     if (PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD) != null)
     {
         SetNetWorkIcon(playerIcon_);
     }
     return(this);
 }
示例#8
0
        private void OnNewGiftReaded()
        {
            PlayerPrefTool.SetIsThereNewGift(false);

            if (false == PlayerPrefTool.GetIsThereNewFriend() && false == PlayerPrefTool.GetIsThereNewApply())
            {
                GameEvents.RedPointEvents.User_OnNewFriendEvent.SafeInvoke(false);
            }
        }
示例#9
0
        public static void OnAccountChangeToGuest(bool is_not_reg_ = false)
        {
            PlayerPrefTool.SetUsername("", ENUM_LOGIN_TYPE.E_THIRD);
            PlayerPrefTool.SetUsername("", ENUM_LOGIN_TYPE.E_GUEST);

            if (!is_not_reg_)
            {
                RequestRegisterGuest();
            }
        }
示例#10
0
        private void ShowGiftView()
        {
            GameEvents.RedPointEvents.Sys_OnNewGiftReadedEvent.SafeInvoke();
            ShowGiftRedPoint(PlayerPrefTool.GetIsThereNewGift());

            this.Refresh(FRIEND_UI_TOGGLE_TYPE.gift);
            GameEvents.RedPointEvents.Sys_OnNewFriendReadedEvent.SafeInvoke();

            CurViewLogic().RequestViewGift();
        }
示例#11
0
        private void OnNewEmailNotify(object msg)
        {
            Debug.LogWarning("新邮件通知!!!!!!!!");

            PlayerPrefTool.SetIsThereNewEmail(true);

            if (!GameEvents.RedPointEvents.User_OnNewEmailEvent.IsNull)
            {
                GameEvents.RedPointEvents.User_OnNewEmailEvent.SafeInvoke();
            }
        }
示例#12
0
        //#endif

        /// <summary>
        /// 引擎初始化完成
        /// </summary>
        private void OnEngineReady()
        {
            EngineCoreEvents.SystemEvents.OnEngineReady -= OnEngineReady;

            this.m_isEngineReady = true;

            PlayerPrefTool.SetBool(ENUM_PREF_KEY.E_FIRST_TIME_LAUNCH.ToString(), false);

            m_clientFsm.GotoState((int)ClientFSM.ClientState.INIT);

            //GuidManager.Instance.LoadGuid();
        }
        private void OnInitCompleteWithGuestCheck()
        {
            Debug.Log("FACEBOOK : OnInitCompleteWithGuestCheck");

#if UNITY_EDITOR || !UNITY_STANDALONE_WIN
            //if (!FB.IsInitialized)
            //{
            //    return;
            //}
#endif

            LoginUtil.RequestCheckToken(PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_GUEST));
        }
        //        private void NativeFaceBookLogin()
        //        {
        //            Debug.Log("FACEBOOK : NativeFaceBookLogin");
        //#if TEST
        //            RequestFaceBookLogin(test_token,
        //                        test_id,
        //                        test_expire_time,
        //                        SystemInfo.deviceUniqueIdentifier,
        //                        this.GetOsTypeEnum());
        //#else
        //            if (AccessToken.CurrentAccessToken != null)
        //            {

        //                RequestFaceBookLogin(AccessToken.CurrentAccessToken.TokenString,
        //                        AccessToken.CurrentAccessToken.UserId,
        //                        AccessToken.CurrentAccessToken.ExpirationTime.TotalSeconds(),
        //                        SystemInfo.deviceUniqueIdentifier,
        //                        this.GetOsTypeEnum());
        //            }
        //            else
        //            {
        //                Debug.Log("FACEBOOK : logged in but no token");
        //            }
        //#endif

        //        }

        //        private bool BindGuestToFacebook()
        //        {
        //            if (null != PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_GUEST))
        //            {
        //                Debug.Log("FACEBOOK : BindGuestToFacebook");

        //                CSFBBindRequest req = new CSFBBindRequest();
        //                req.Identify = PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_GUEST);

        //#if TEST
        //                req.AccessToken = test_token;
        //                req.FbId = test_id;
        //                req.ExpiresIn = test_expire_time;
        //#else
        //                req.AccessToken = AccessToken.CurrentAccessToken.TokenString;
        //                req.FbId = AccessToken.CurrentAccessToken.UserId;
        //                req.ExpiresIn = AccessToken.CurrentAccessToken.ExpirationTime.TotalSeconds();
        //#endif
        //                GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
        //                DebugUtil.Log("send CSFBBindRequest");
        //                return true;
        //            }

        //            return false;
        //        }

        private void OnInitCompleteWithThirdCheck()
        {
            Debug.Log("FACEBOOK : OnInitCompleteWithoutLogin");

#if UNITY_EDITOR || !UNITY_STANDALONE_WIN
            if (!FB.IsInitialized)
            {
                return;
            }
#endif

            LoginUtil.RequestCheckToken(PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD));
        }
示例#15
0
            public void SetType(GuidStartCartoonType type, float m_screenX, long ID)
            {
                m_GuidID    = ID;
                cartoonType = type;

                if (type == GuidStartCartoonType.HEAD)
                {
                    //GameEvents.UIEvents.UI_StartCartoon_Event.OnNextBtnVisible.SafeInvoke(false,0);

                    ENUM_LOGIN_TYPE loginType = ENUM_LOGIN_TYPE.E_GUEST;
                    if (null != PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD))
                    {
                        loginType = ENUM_LOGIN_TYPE.E_THIRD;
                    }

                    int       headCount = CommonData.CartoonHEAD.Count;
                    Transform headRoot  = gameObject.transform.Find("Panel (1)/Panel");
                    this.m_TweenHead = headRoot.GetComponent <TweenScale>();
                    this.m_IconTex   = Make <GameNetworkRawImage>("icon");
                    this.m_IconTween = m_IconTex.GetComponent <TweenScale>();

                    Material mat = new Material(ShaderModule.Instance.GetShader("SeekerGame/ImageBlur"));
                    mat.SetFloat("_BlurRadius", 1.5f);
                    bgTexture = Make <GameTexture>("RawImage");
                    bgTexture.RawImage.material = mat;

                    m_HeadCon   = Make <GameUIContainer>("Panel:grid");
                    m_gridValue = m_HeadCon.GetComponent <GridValue>();
                    float gridWidth = headCount * 150 + m_gridValue.m_spacing * (headCount - 1);
                    m_HeadCon.Widget.sizeDelta = new Vector2(gridWidth, m_HeadCon.Widget.sizeDelta.y);
                    m_HeadCon.EnsureSize <GuidHeadUILogic>(headCount);
                    for (int i = 0; i < headCount; i++)
                    {
                        GuidHeadUILogic head = m_HeadCon.GetChild <GuidHeadUILogic>(i);
                        head.SetData(m_screenX, i, m_gridValue.m_spacing, loginType);
                        head.Visible = true;
                    }
                }
                else if (type == GuidStartCartoonType.NAME)
                {
                    m_InputName               = Make <GameInputField>("Panel (1):RawImage:InputField");
                    m_InputName.Text          = "Guest_" + GlobalInfo.MY_PLAYER_ID;
                    m_effect                  = Make <GameUIEffect>("Panel (1):RawImage:Effect:UI_xinshouyindao_shou");
                    m_effect.EffectPrefabName = "UI_xinshouyindao_shou.prefab";
                    m_effect.Visible          = true;
                    GameEvents.UIEvents.UI_StartCartoon_Event.OnNextBtnVisible.SafeInvoke(false, 1);

                    m_InputName.AddClickCallBack(InputClick);
                }
            }
        private void LoadPoolTaskFromPlayerPref()
        {
            List <TaskOnBuild> task_bulids = PlayerPrefTool.GetPoolTaskAnchor();

            if (null == task_bulids)
            {
                return;
            }

            foreach (var item in task_bulids)
            {
                pool_task_anchor_dict.Add(item.TaskID, item.Name);
            }
        }
示例#17
0
        private void OnRefreshByPlayerPrefs()
        {
            if (PlayerPrefTool.GetIsThereNewEmail())
            {
                OnNewEmailNotify(null);
            }

            if (PlayerPrefTool.GetIsThereNewFriend() || PlayerPrefTool.GetIsThereNewApply() || PlayerPrefTool.GetIsThereNewGift())
            {
                OnNewFriendNotify(null);
            }


            if (PlayerPrefTool.GetIsThereNewActivity())
            {
                OnNewActivityNotify(null);
            }

            if (PlayerPrefTool.GetIsThereNewAchievement())
            {
                OnNewAchievementNotify(null);
            }

            if (PlayerPrefTool.GetIsThereNewNotice())
            {
                OnNewNoticeNotify(null);
            }
#if OFFICER_SYS
            if (PlayerPrefTool.GetIsThereNewPolice())
            {
                OnNewPoliceNotify();
            }
#endif

            if (PlayerPrefTool.GetIsThereNewChapterNPC())
            {
                OnNewChapterTypeNotify(0);
            }

            if (PlayerPrefTool.GetIsThereNewChapterClue())
            {
                OnNewChapterTypeNotify(1);
            }

            if (PlayerPrefTool.GetIsThereNewChapterScene())
            {
                OnNewChapterTypeNotify(2);
            }
        }
示例#18
0
        private void OnNewAchievementNotify(object msg)
        {
            PlayerPrefTool.SetIsThereNewAchievement(true);
            if (!GameEvents.RedPointEvents.User_OnNewAchievementEvent.IsNull)
            {
                if (msg != null)
                {
                    SCAchievementUnlockResponse achievementMsg = (SCAchievementUnlockResponse)msg;
                    AchievementPopHintUILogic.Show(achievementMsg.Id);

                    GameEvents.PlayerEvents.RequestRecentAhievement.SafeInvoke();
                }
                GameEvents.RedPointEvents.User_OnNewAchievementEvent.SafeInvoke();
            }
        }
示例#19
0
        public void ShowContent(bool v_)
        {
            m_friend_info_list_root.Visible = false;
            m_friend_application_root.Visible = false;
            m_friend_confirm_root.Visible = false;
            m_add_friend_root.Visible = false;
            m_gift_root.Visible = false;

            if (v_)
            {
                ShowConfirmRedPoint(false);
                ShowApplyRedPoint(PlayerPrefTool.GetIsThereNewApply());
                ShowGiftRedPoint(PlayerPrefTool.GetIsThereNewGift());
                this.SwitchUI(FRIEND_UI_TOGGLE_TYPE.Added);
            }
        }
示例#20
0
        private static void RequestFaceBookLogin(string accessToken,
                                                 string fbId, long expiresIn, string deviceId, OsType osType)
        {
            CSFBLoginRequest req = new CSFBLoginRequest();

            req.AccessToken = accessToken;
            req.FbId        = fbId;
            req.ExpiresIn   = expiresIn;
            req.DeviceId    = deviceId;
            req.OsType      = osType;
            req.Ad          = PlayerPrefTool.GetADChannel();
            //GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);

            DebugUtil.Log("send CSFBLoginRequest");
        }
示例#21
0
        private void OnRes(object obj)
        {
            if (obj is SCBuildingListResp)
            {
                SCBuildingListResp res = obj as SCBuildingListResp;
                for (int i = 0; i < res.Infos.Count; i++)
                {
                    BuildingInfo buildInfo = res.Infos[i];
                    if (buildInfo.Status > 0)
                    {
                        if (buildInfo.Status == 2)
                        {
                            if (!PlayerPrefTool.GetBuildLockCache(buildInfo.BuildingId))
                            {
                                System.Collections.Generic.Dictionary <UBSParamKeyName, object> _params = new System.Collections.Generic.Dictionary <UBSParamKeyName, object>()
                                {
                                    { UBSParamKeyName.ContentID, buildInfo.BuildingId },
                                    { UBSParamKeyName.ContentType, "canlock" },
                                    { UBSParamKeyName.Description, System.DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ss:ms") },
                                };
                                UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.build_plan, null, _params);
                            }
                        }
                        if (NewGuid.GuidNewManager.Instance.GetProgressByIndex(7))
                        {
                            m_gameObject.LockBuildStatus(buildInfo.BuildingId, buildInfo.Status);
                        }
                        //if (SeekerGame.NewGuid.GuidNewManager.Instance.GetProgressByIndex(2))
                        //{
                        //    //解锁或可解锁

                        //}
                    }
                }

                //if (res.Infos!= null)
                //{
                //    int infoCount = res.Infos.Count;

                //    if (infoCount > 0 && res.Infos[infoCount - 1].BuildingId < ConfBuilding.array.Count - 1 && res.Infos[infoCount - 1].Status == 1)
                //    {
                //        m_gameObject.LockBuildStatus(res.Infos[infoCount - 1].BuildingId + 1, 3);
                //    }

                //}
            }
        }
示例#22
0
        public void didReceiveConversionData(string conversionData)
        {
            bool firstLaunch = false;

#if UNITY_ANDROID
            AppsflyerData4Android data = JsonSerializer.Deserialize <AppsflyerData4Android>(conversionData);

            string first_launch_str = data.is_first_launch;
            firstLaunch = false;
            if (!bool.TryParse(first_launch_str, out firstLaunch))
            {
                int fl_int;
                if (int.TryParse(first_launch_str, out fl_int))
                {
                    firstLaunch = 1 == fl_int ? true : false;
                }
            }

            if ("Non-organic".Equals(data.af_status))
            {
                if (firstLaunch)
                {
                    PlayerPrefTool.SetADChannel(data.campaign);
                }
            }
            else
            {
                Debug.LogError("This is an organic install");
            }
#else
            AppsflyerData data = JsonSerializer.Deserialize <AppsflyerData>(conversionData);
            firstLaunch = data.is_first_launch;

            if ("Non-organic".Equals(data.af_status))
            {
                if (firstLaunch)
                {
                    PlayerPrefTool.SetADChannel(data.campaign);
                }
            }
            else
            {
                Debug.LogError("This is an organic install");
            }
#endif
        }
        public void SavePoolTaskToPlayerPref()
        {
            List <TaskOnBuild> pool_task_bulids = new List <TaskOnBuild>();

            foreach (var kvp in pool_task_anchor_dict)
            {
                TaskOnBuild item = new TaskOnBuild()
                {
                    Name   = kvp.Value,
                    TaskID = (long)kvp.Key,
                };

                pool_task_bulids.Add(item);
            }

            PlayerPrefTool.SetPoolTaskAnchor(pool_task_bulids);
        }
示例#24
0
 private static void OnScResponse(object s)
 {
     if (s is SCRegGuestResponse)
     {
         MessageHandler.UnRegisterMessageHandler(MessageDefine.SCRegGuestResponse, OnScResponse);
         GOEngine.DebugUtil.Log("receive SCRegGuestResponse");
         if (s != null)
         {
             var rsp = s as SCRegGuestResponse;
             if (!string.IsNullOrEmpty(rsp.GuestIdentify))
             {
                 PlayerPrefTool.SetUsername(rsp.GuestIdentify, ENUM_LOGIN_TYPE.E_GUEST);
                 GOEngine.DebugUtil.Log("GuestIdentify:" + rsp.GuestIdentify);
             }
         }
     }
 }
示例#25
0
        public override void OnShow(object param)
        {
            ShowConfirmRedPoint(false);
            ShowApplyRedPoint(PlayerPrefTool.GetIsThereNewApply());
            ShowGiftRedPoint(PlayerPrefTool.GetIsThereNewGift());
            this.SwitchUI(FRIEND_UI_TOGGLE_TYPE.Added);

            m_toggle_info.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Added, LocalizeModule.Instance.GetString("friend_1"), true, OnToggleClick);
            m_toggle_application.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Agreeing, LocalizeModule.Instance.GetString("friend_2"), false, OnToggleClick);
            m_toggle_confirm.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Addinfo, LocalizeModule.Instance.GetString("friend_3"), false, OnToggleClick);
            m_view_gifts_toggle.Refresh((int)FRIEND_UI_TOGGLE_TYPE.gift, LocalizeModule.Instance.GetString("friend_receive"), false, OnToggleClick);
            m_add_friend_toggle.Refresh((int)FRIEND_UI_TOGGLE_TYPE.scarch, LocalizeModule.Instance.GetString("friend_invite_btn"), false, OnToggleClick);
            m_application_switch.AddClickCallBack(OnApplicationToggleClicked);
            m_ignore_all_btn.AddClickCallBack(OnIgnoreAllClick);
            m_recommend_btn.AddClickCallBack(OnRecommendClick);

        }
示例#26
0
        private void OnNewChapterReaded(int type)
        {
            if (type == 0)
            {
                PlayerPrefTool.SetIsThereNewChapterNPC(false);
            }
            else if (type == 1)
            {
                PlayerPrefTool.SetIsThereNewChapterClue(false);
            }
            else if (type == 2)
            {
                PlayerPrefTool.SetIsThereNewChapterScene(false);
            }
            CSClearChapterRedRequest req = new CSClearChapterRedRequest();

            req.ClearType = type;
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
        }
示例#27
0
 private void OnNewChapterTypeNotify(int type)
 {
     if (type == 0)
     {
         PlayerPrefTool.SetIsThereNewChapterNPC(true);
     }
     else if (type == 1)
     {
         PlayerPrefTool.SetIsThereNewChapterClue(true);
     }
     else if (type == 2)
     {
         PlayerPrefTool.SetIsThereNewChapterScene(true);
     }
     if (!GameEvents.RedPointEvents.User_OnNewChapterEvent.IsNull)
     {
         GameEvents.RedPointEvents.User_OnNewChapterEvent.SafeInvoke(type);
     }
 }
示例#28
0
        public static void RequestRegisterGuest()
        {
            string uid     = SystemInfo.deviceUniqueIdentifier;
            string os_type = GetOsType();


            CSRegGuestRequest req = new CSRegGuestRequest();

#if UNITY_DEBUG
            req.DeviceId = "fotoable";
#else
            req.DeviceId = uid;
#endif
            req.OsType = os_type;
            req.Ad     = PlayerPrefTool.GetADChannel();

            //GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
        }
示例#29
0
        private void OnNewFriendNotify(object msg)
        {
            if (null == msg)
            {
                GameEvents.RedPointEvents.User_OnNewFriendEvent.SafeInvoke(true);

                FriendDataManager.Instance.RefreshFriendInfo(FriendReqType.Added);
                TimeModule.Instance.SetTimeout(() => FriendDataManager.Instance.RefreshFriendInfo(FriendReqType.Addinfo), 0.5f);
                TimeModule.Instance.SetTimeout(() => FriendDataManager.Instance.RefreshFriendInfo(FriendReqType.Agreeing), 1.0f);
                TimeModule.Instance.SetTimeout(() => FriendDataManager.Instance.RefreshFriendGift(), 1.5f);

                return;
            }

            //1:有新增好友,2:有好友请求 3:有好友礼物
            var rsp = msg as SCFriendNoticeResponse;

            if (1 == rsp.Point)
            {
                PlayerPrefTool.SetIsThereNewFriend(true);
                GameEvents.RedPointEvents.User_OnNewFriendEvent.SafeInvoke(true);

                FriendDataManager.Instance.RefreshFriendInfo(FriendReqType.Added);
                TimeModule.Instance.SetTimeout(() => FriendDataManager.Instance.RefreshFriendInfo(FriendReqType.Addinfo), 0.5f);
            }
            else if (2 == rsp.Point)
            {
                PlayerPrefTool.SetIsThereNewApply(true);
                GameEvents.RedPointEvents.User_OnNewFriendEvent.SafeInvoke(true);

                FriendDataManager.Instance.RefreshFriendInfo(FriendReqType.Agreeing);
            }
            else if (3 == rsp.Point)
            {
                PlayerPrefTool.SetIsThereNewGift(true);
                GameEvents.RedPointEvents.User_OnNewFriendEvent.SafeInvoke(true);
                FriendDataManager.Instance.RefreshFriendGift();
            }
        }
示例#30
0
        public void Init()
        {
            EngineCore.EngineCoreEvents.BridgeEvent.GetServerAddress = () =>
            {
                return(SERVER_ADDRESS);
            };

            EngineCore.EngineCoreEvents.SystemEvents.FetchUserIdentification = () =>
            {
                return(ACCOUNT_TOKEN);
            };

            Enable_Music = PlayerPrefTool.GetBool(ENUM_PREF_KEY.E_ENABLE_MUSIC.ToString(), true);
            Enable_Sound = PlayerPrefTool.GetBool(ENUM_PREF_KEY.E_ENABLE_SOUND.ToString(), true);

            EngineCore.EngineCoreEvents.AudioEvents.FetchAudioPathByKey = FetchAudioPathByKey;
            GameEvents.System_Events.PlayMainBGM = PlayMainAudio;


            InitAudioBridge();

            InitDefaultAudioKey();
        }