Exemplo n.º 1
0
    /// <summary>
    /// 技能触发成功
    /// </summary>
    /// <param name="data"></param>
    void OnAttackSucc(CEventBaseArgs data)
    {
        //uint skill_id = System.Convert.ToUInt32(data.arg);
        //if (skill_id != mSkillIdx)
        //    return;

        if (mClickEffect != null)
        {
            mClickEffect.SetActive(false);
            mClickEffect.SetActive(true);

            if (mClickEffect_DelayEnableComponent == null)
            {
                mClickEffect_DelayEnableComponent = mClickEffect.AddComponent <DelayEnableComponent>();
            }
            if (mClickEffect_DelayEnableComponent != null)
            {
                mClickEffect_DelayEnableComponent.DelayTime = 2.0f;
                mClickEffect_DelayEnableComponent.SetEnable = false;
                mClickEffect_DelayEnableComponent.Start();
            }
        }

        Game.GetInstance().GetLocalPlayer().CDCtrl.StartCD(mSkillIdx);
    }
Exemplo n.º 2
0
        void OnClickPlayer(CEventBaseArgs data)
        {
            // 破碎死域要屏蔽这个界面
            if (SceneHelp.Instance.IgnoreClickPlayer == true)
            {
                return;
            }

            GameObject selectedObj = (GameObject)data.arg;

            if (selectedObj != null)
            {
                ActorMono actMono = ActorHelper.GetActorMono(selectedObj);
                if (actMono != null)
                {
                    Actor actor = actMono.BindActor;
                    if (actor != null && (actor is LocalPlayer) == false && ActorHelper.IsShemale(actor.UID.obj_idx) == false)
                    {
                        Dictionary <string, string> playerInfo = new Dictionary <string, string>();
                        playerInfo.Clear();
                        playerInfo.Add("uuid", actor.UID.obj_idx.ToString());
                        xc.ui.ugui.UIManager.Instance.ShowWindow("UIWatchPlayerWindow", playerInfo);
                    }
                }
            }
        }
Exemplo n.º 3
0
 static int _m_PostEvent(RealStatePtr L)
 {
     
     ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);
     
     
     ClientEventMgr __cl_gen_to_be_invoked = (ClientEventMgr)translator.FastGetCSObj(L, 1);
     
     
     try {
         
         {
             int eventID = LuaAPI.xlua_tointeger(L, 2);
             CEventBaseArgs arg = (CEventBaseArgs)translator.GetObject(L, 3, typeof(CEventBaseArgs));
             
             __cl_gen_to_be_invoked.PostEvent( eventID, arg );
             
             
             
             return 0;
         }
         
     } catch(System.Exception __gen_e) {
         return LuaAPI.luaL_error(L, "c# exception:" + __gen_e);
     }
     
 }
Exemplo n.º 4
0
        void OnSelectActorChange(CEventBaseArgs msg)
        {
            if (mUIObject == null)
            {
                return;
            }

            if (msg == null || msg.arg == null)
            {
                mTargetMono = null;
                SetHpBarPanelVisible(false);
                return;
            }

            var monoActor = msg.arg as ActorMono;

            if (monoActor == null || monoActor.BindActor == null || !monoActor.BindActor.IsBoss())
            {
                mTargetMono = null;
                SetHpBarPanelVisible(false);
                return;
            }

            if (mTargetMono != null && monoActor.BindActor.UID == mTargetMono.BindActor.UID)
            {
                return;
            }

            SetHpBarPanelVisible(true);
            mTargetMono = monoActor;
            InitData();

            SetBossInfoPanel();
        }
Exemplo n.º 5
0
        void OnSwitchScene(CEventBaseArgs kArgs)
        {
            Clear();

            foreach (SGameEngine.AssetResource ar in mPreloadedTimelineReses.Values)
            {
                if (ar != null)
                {
                    ar.destroy();
                }
            }
            mPreloadedTimelineReses.Clear();

            foreach (Coroutine coroutine in mLoadPrefabCoroutines)
            {
                SGameEngine.ResourceLoader.Instance.StopCoroutine(coroutine);
            }
            mLoadPrefabCoroutines.Clear();

            Actor localPlayer = Game.Instance.GetLocalPlayer();

            if (localPlayer != null && localPlayer.mAvatarCtrl != null && localPlayer.mAvatarCtrl.GetLatestAvatartProperty() != null)
            {
                mPlayerLastSceneAvatarProperty = localPlayer.mAvatarCtrl.GetLatestAvatartProperty();
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// 响应支付信息改变的事件
        /// </summary>
        /// <param name="data"></param>
        void OnChargeInfoUpdate(CEventBaseArgs data)
        {
            if (IsShow == false)
            {
                return;
            }

            if (mPayItemInfo == null)
            {
                return;
            }

            // 需要更新购买按钮的状态
            uint limit_times = ChargeManager.Instance.GetLimitTimes(mPayItemInfo.Id);

            if (limit_times >= mPayItemInfo.LimitTimes)
            {
                mBuyButton.interactable = false;
                mBuyText.text           = xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_96");
            }
            else
            {
                mBuyButton.interactable = true;
                mBuyText.text           = xc.TextHelper.GetConstText("CODE_TEXT_LOCALIZATION_97");
            }
        }
Exemplo n.º 7
0
 void OnModelChange(CEventBaseArgs param)
 {
     if (mHPComponent != null)
     {
         mHPComponent.HeadOffset = new Vector3(0f, mOwner.Height - 0.2f, 0f);
     }
 }
Exemplo n.º 8
0
    /// <summary>
    /// 技能触发成功
    /// </summary>
    /// <param name="data"></param>
    void OnAttackSucc(CEventBaseArgs data)
    {
        uint skill_id = (uint)data.arg;

        if (skill_id != mSkillIdx)
        {
            return;
        }

        if (mClickEffect != null)
        {
            SetObjectActive(mClickEffect, false);
            SetObjectActive(mClickEffect, true);

            if (mClickEffectDelayer == null)
            {
                mClickEffectDelayer = mClickEffect.AddComponent <DelayEnableComponent>();
            }

            if (mClickEffectDelayer != null)
            {
                mClickEffectDelayer.DelayTime = 2.0f;
                mClickEffectDelayer.SetEnable = false;
                mClickEffectDelayer.Start();
            }
        }
    }
Exemplo n.º 9
0
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 2 && translator.Assignable <object>(L, 2))
                {
                    object obj = translator.GetObject(L, 2, typeof(object));

                    CEventBaseArgs __cl_gen_ret = new CEventBaseArgs(obj);
                    translator.Push(L, __cl_gen_ret);
                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    CEventBaseArgs __cl_gen_ret = new CEventBaseArgs();
                    translator.Push(L, __cl_gen_ret);
                    return(1);
                }
            }
            catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to CEventBaseArgs constructor!"));
        }
Exemplo n.º 10
0
        /// <summary>
        /// 监听队伍发送改变就请求队伍位置
        /// </summary>
        /// <param name="args"></param>
        public void TeamChange(CEventBaseArgs args)
        {
            if (IsEnable == false)
            {
                return;
            }
            for (int i = 0; i < mTeamListPointObjs.Count; i++)
            {
                UIResourceManager.Instance.ReturnObjectToPool(mTeamListPointObjs[i]);
            }
            if (TeamManager.Instance.TeamMembers != null)
            {
                foreach (var item in TeamManager.Instance.TeamMembers)
                {
                    if (item.dungeon_id != m_MapId &&
                        item.brief.uuid != LocalPlayerManager.Instance.LocalActorAttribute.UnitId.obj_idx &&
                        xc.SpanServerManager.Instance.IsInSameServer(item.brief.uuid))
                    {
                        GameObject go;
                        if (mMapGoDic.TryGetValue((int)item.dungeon_id, out go))
                        {
                            var rect      = GetItem(mTeamPointTemplate);
                            var refObjPos = GetMapPointRefObjPos(go);

                            rect.localPosition = new Vector3(refObjPos.x + 60, refObjPos.y + 15, 0);
                            mTeamListPointObjs.Add(rect.gameObject);
                        }
                    }
                }
            }
        }
Exemplo n.º 11
0
        public void OnAddUnderAttackActor(CEventBaseArgs msg)
        {
            if (msg == null || msg.arg == null)
            {//取消选中目标
                return;
            }
            uint obj_idx         = (uint)msg.arg;
            bool need_reset_list = false;

            if (mDataArray.Count == 0)
            {
                need_reset_list = true;
            }

            HostileAttackData find_data = mDataArray.Find((a) => { return(a.obj_idx == obj_idx); });

            if (find_data == null)
            {
                HostileAttackData new_data = new HostileAttackData();
                new_data.obj_idx          = obj_idx;
                new_data.last_attack_time = Time.realtimeSinceStartup;
                mDataArray.Add(new_data);
            }
            else
            {
                find_data.last_attack_time = Time.realtimeSinceStartup;
            }
            if (need_reset_list)
            {
                ResetList();
            }
        }
Exemplo n.º 12
0
        void OnSelectActorChange(CEventBaseArgs msg)
        {
            if (mUIObject == null)
            {
                return;
            }

            if (msg == null || msg.arg == null)
            {//取消选中目标
                if (mTargetMono != null)
                {
                    TryRefreshSelectPlayer();
                }
                return;
            }

            var monoActor = msg.arg as ActorMono;

            if (monoActor == null || monoActor.BindActor == null)
            {
                if (mTargetMono != null)
                {
                    TryRefreshSelectPlayer();
                }
                return;
            }

            if (mTargetMono != null && monoActor.BindActor.UID == mTargetMono.BindActor.UID)
            {
                return;
            }

            TryRefreshSelectPlayer();
        }
Exemplo n.º 13
0
 void OnActorEnterGame(CEventBaseArgs kArgs)
 {
     FriendsManager.Instance.LoadCloser();
     GetFriendList(FriendType.Friend, 1);
     GetFriendList(FriendType.Enemy, 1);
     GetFriendList(FriendType.Black, 1);
 }
Exemplo n.º 14
0
    public void FireEvent(int eventID, CEventBaseArgs arg)
    {
        List <ClientEventFunc> funcs;

        if (mEventHandlers.TryGetValue(eventID, out funcs))
        {
            List <ClientEventFunc> mTmpRunFuncs = Pool <ClientEventFunc> .List.New(funcs.Count);

            //List<ClientEventFunc> mTmpRunFuncs = new List<ClientEventFunc>(funcs.Count);
            foreach (ClientEventFunc func in funcs)
            {
                if (func != null)
                {
                    mTmpRunFuncs.Add(func);
                }
            }

            // 在触发事件时,可能会反注册
            foreach (ClientEventFunc func in mTmpRunFuncs)
            {
                func(arg);
            }

            Pool <ClientEventFunc> .List.Free(mTmpRunFuncs);
        }
    }
Exemplo n.º 15
0
        /// <summary>
        /// 响应完成加载场景资源的消息
        /// </summary>
        /// <param name="arg"></param>
        void OnFinishSwitchScene(CEventBaseArgs arg)
        {
            // 当前处于普通野外的时候,才重新弹出窗口
            if (SceneHelp.Instance.IsInNormalWild(SceneHelp.Instance.CurSceneID))
            {
                foreach (var info in mReopenWindows)
                {
                    if (info.IsSystemWindow)
                    {
                        if (info.SubSystemInfo != null)
                        {
                            ShowSysWindowEx(info.Name, info.IsMainmapSwitch, info.SubSystemInfo);
                        }
                        else
                        {
                            ShowSysWindowEx(info.Name, info.IsMainmapSwitch);
                        }
                    }
                    else
                    {
                        ShowWindow(info.Name);
                    }
                }
            }


            mReopenWindows.Clear();
        }
Exemplo n.º 16
0
        public void OnClicked(CEventBaseArgs args)
        {
            Actor localPlayer = Game.GetInstance().GetLocalPlayer();

            if (localPlayer == null || localPlayer.IsDead() == true)
            {
                return;
            }

            if (args == null || args.arg == null)
            {
                return;
            }

            GameObject clickedObject = args.arg as GameObject;

            // 实际点击的是该组件的孩子
            if (clickedObject == null || clickedObject.transform == null || clickedObject.transform.parent == null || clickedObject.transform.parent.gameObject == null || clickedObject.transform.parent.gameObject != this.gameObject)
            {
                return;
            }

            // 帮派篝火要判断是否还有烤肉次数和背包是否已满
            if (mClass == "guild_league_fire")
            {
                if (GuildBonfireCheckCanMeat(true) == false)
                {
                    return;
                }

                if (ItemManager.Instance.BagIsFull(1) == true)
                {
                    UINotice.Instance.ShowMessage(DBConstText.GetText("BAG_IS_FULL"));
                    return;
                }
            }

            // 跨服boss大宝箱
            if (mClass == "span_boss_big_box" || mClass == "span_boss_little_box")
            {
                if (CheckCanGetServerBossBox(true) == false)
                {
                    return;
                }
            }

            mIsClickedTouch = true;

            if (!IsLocalPlayerCloseEnoughToEnter)
            {
                bool    result = false;
                Vector3 pos    = transform.position;
                pos = InstanceHelper.ClampInWalkableRange(pos, pos, out result);
                localPlayer.MoveCtrl.TryWalkToAlong(pos);
            }
            else
            {
                OnTouchEnter();
            }
        }
Exemplo n.º 17
0
 /// <summary>
 ///服务器更新时间
 /// </summary>
 /// <param name="data"></param>
 void OnServerTimeUpdate(CEventBaseArgs data)
 {
     if (Is_CD == true)
     {
         if (CdImageTrans != null && TimeText != null)
         {
             if (CDTime < Game.GetInstance().ServerTime)
             {
                 Is_CD = false;
                 CdImageTrans.gameObject.SetActive(false);
                 TimeText.text = DBConstText.GetText("BAG_UNLOCK1");
                 DetalTime     = 0;
                 CdImageTrans.localEulerAngles = new Vector3(CdImageTrans.localEulerAngles.x, CdImageTrans.localEulerAngles.y, 360);
             }
             else
             {
                 var detal      = (float)(CDTime - StartTime);
                 var star_detal = Mathf.Abs((float)(Game.GetInstance().ServerTime - StartTime));
                 ZDetalRotation = (1 - star_detal / detal) * 360.0f;
                 var cdEnd = CDTime - Game.GetInstance().ServerTime;
                 CdImageTrans.localEulerAngles = new Vector3(CdImageTrans.localEulerAngles.x, CdImageTrans.localEulerAngles.y, ZDetalRotation);
                 TimeText.text = DateHelper.GetMMSS(cdEnd);
             }
         }
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// 切换场景的时候需要重置烟花特效
 /// </summary>
 /// <param name="data"></param>
 void OnStartSwitchScene(CEventBaseArgs data)
 {
     if (mEmitInfo != null && !mEmitInfo.IsFinish)
     {
         mEmitInfo.Stop();
     }
 }
Exemplo n.º 19
0
        /// <summary>
        /// 监听队伍发送改变就请求队伍位置
        /// </summary>
        /// <param name="args"></param>
        public void UpdateRequsetTeam(CEventBaseArgs args)
        {
            if (IsEnable == false)
            {
                return;
            }
            if (mUpdateTeamPosCd != null)
            {
                return;
            }
            if (TeamManager.Instance.HaveTeam)
            {
                mUpdateTeamPosCd = new Utils.Timer(2000, true, 3000,
                                                   (dt) =>
                {
                    if (!m_bNetAnswer)
                    {
                        ClearTeamPoint();
                    }

                    m_bNetAnswer = false;
                    var data     = new C2STeamMemberPos();
                    NetClient.GetBaseClient().SendData <C2STeamMemberPos>(NetMsg.MSG_TEAM_MEMBER_POS, data);
                });
            }
        }
Exemplo n.º 20
0
 void OnInstall1Update(CEventBaseArgs data)
 {
     if (mAutoSellGoods == true)
     {
         CheckAllGoodsAndSellGoods();
     }
 }
Exemplo n.º 21
0
        protected virtual void OnPickDrop(CEventBaseArgs data)
        {
            CEventObjectArgs args           = (CEventObjectArgs)data;
            PkgDropGive      dropInfo       = (PkgDropGive)args.Value[0];
            uint             dropType       = (uint)args.Value[1];
            GameObject       dropGameObject = (GameObject)args.Value[2];

            if (dropType == 0)
            {
                GameDebug.LogError("Can not this drop " + dropInfo.oid + ", because it's drop type is zero!!!");
                return;
            }

            C2SNwarPick msg = new C2SNwarPick();

            msg.oid       = dropInfo.oid;
            msg.drop_type = dropType;
            NetClient.GetBaseClient().SendData <C2SNwarPick>(NetMsg.MSG_NWAR_PICK, msg);

            //GameDebug.LogError("Send MSG_NWAR_PICK: " + msg.oid + ", " + msg.drop_type);

            //// 使碰撞体失效
            //dropGameObject.transform.Find("Mesh").GetComponent<SphereCollider>().enabled = false;

            //int delayTime = 1000;
            //mTimerList.Add(new Utils.Timer(delayTime, false, delayTime, PickDropImpl, tfArgs));
        }
Exemplo n.º 22
0
    public void FireEvent(int uiEvent, CEventBaseArgs args)
    {
        List <EventProcessFunc> funcList;

        if (mEventMap.TryGetValue(uiEvent, out funcList))
        {
            var tmpfuncList = Pool <EventProcessFunc> .List.New(funcList.Count);

            foreach (var func in funcList)
            {
                tmpfuncList.Add(func);
            }

            using (var iter = tmpfuncList.GetEnumerator())
            {
                while (iter.MoveNext())
                {
                    var func = iter.Current;
                    if (func != null)
                    {
                        func(args);
                    }
                }
            }

            Pool <EventProcessFunc> .List.Free(tmpfuncList);
        }
    }
Exemplo n.º 23
0
 void OnAutoFightStateChangedChanged(CEventBaseArgs data)
 {
     if (mAutoSellGoods == true)
     {
         CheckAllGoodsAndSellGoods();
     }
 }
Exemplo n.º 24
0
        /// <summary>
        /// 拾取的碎片消失
        /// </summary>
        /// <param name="data"></param>
        void OnDisappearBossChip(CEventBaseArgs data)
        {
            if (data == null || data.arg == null)
            {
                return;
            }
            if (mTimer == null)
            {
                return;
            }
            PkgDropGive param_PkgDropGive = data.arg as PkgDropGive;

            if (mDropInfo != param_PkgDropGive)
            {
                return;
            }
            //GameDebug.LogError("OnDisappearBossChip");
            StopAnim(true);
            Actor local_player = Game.Instance.GetLocalPlayer();

            if (local_player != null)
            {
                local_player.Stand();
            }
        }
Exemplo n.º 25
0
    void OnMoneyUpdate(CEventBaseArgs args)
    {
//        if (mGoldLabel != null)
//            mGoldLabel.text = "" + xc.LocalPlayerManager.Instance.Gold;
        if (mCoinLabel != null)
        {
            mCoinLabel.text = "" + xc.LocalPlayerManager.Instance.Coin;
        }
//        if (mBloodLabel != null)
//            mBloodLabel.text = "" + xc.LocalPlayerManager.Instance.BloodStone;
        if (mDiamondLabel != null)
        {
            mDiamondLabel.text = "" + xc.LocalPlayerManager.Instance.Diamond;
        }
//        if (mStuffLabel != null)
//            mStuffLabel.text = "" + xc.LocalPlayerManager.Instance.StuffRedeemVoucher;
//        if (mFashionLabel != null)
//            mFashionLabel.text = "" + xc.LocalPlayerManager.Instance.FashionRedeemVoucher;

        if (mBindCoinLabel != null)
        {
            mBindCoinLabel.text = "" + xc.LocalPlayerManager.Instance.BindCoin;
        }
        if (mBindDiamondLabel != null)
        {
            mBindDiamondLabel.text = "" + xc.LocalPlayerManager.Instance.BindDiamond;
        }
    }
Exemplo n.º 26
0
 void OnMoneyUpdate(CEventBaseArgs args)
 {
     for (int i = 0; i < mUIMoneyItemList.Count; i++)
     {
         mUIMoneyItemList[i].Update();
     }
 }
Exemplo n.º 27
0
 private void OnFriendMarkChanged(CEventBaseArgs arg)
 {
     foreach (KeyValuePair <UnitID, Actor> kvp in ActorManager.Instance.PlayerSet)
     {
         kvp.Value.SetNameText();
         kvp.Value.UpdateNameStyle();   //更新头顶PK模式
     }
 }
Exemplo n.º 28
0
 public void OnSystemOpen(CEventBaseArgs eventParam)
 {
     if (eventParam == null || eventParam.arg == null)
     {
         return;
     }
     FreshBySystemId((uint)eventParam.arg);
 }
Exemplo n.º 29
0
 void OnBreakPickBossChip(CEventBaseArgs data)
 {
     if (data == null || data.arg == null)
     {
         return;
     }
     StopAnim(false);
 }
Exemplo n.º 30
0
 void OnChangeLocalPlayerRadius(CEventBaseArgs data)
 {
     foreach (var item in ColliderObjects)
     {
         //if(item.Value != null)
         //    item.Value.SetLocalPlayerRadius(Game.Instance.LocalPlayerRadius);
     }
 }