Ejemplo n.º 1
0
        //达到伤害值,中断技能
        void OnBreakSkill()
        {
            //打断吟唱
            m_skillBase.BreakPrepareSkill();

            UnRegisterEvent();

            if (m_attackBreakDesc.isUsedUI)
            {
                CancelInvoke("UpdateShowTime");
                EventToUI.SendEvent("EU_DPSBAR_HIDE");
            }

            if (m_attackBreakDesc.behitAction.Length == 0)
            {
                m_skillBase.SkillEnd();
                return;
            }

            //播放被击动作
            m_skillBase.m_actor.StopAll();
            m_skillBase.m_actor.PlayAction(m_attackBreakDesc.behitAction);

            //动作完后结束技能
            Invoke("SkillEnd", m_skillBase.m_actor.GetActionLength(m_attackBreakDesc.behitAction));
        }
Ejemplo n.º 2
0
        // Update is called once per frame
        //void Update()
        //{
        //}

        void OnDestroy()
        {
            UnRegisterEvent();

            if (m_attackBreakDesc.isUsedUI)
            {
                CancelInvoke("UpdateShowTime");
                EventToUI.SendEvent("EU_DPSBAR_HIDE");
            }
        }
Ejemplo n.º 3
0
        void PlayStayEfxObj()
        {
            mFallTran.gameObject.SetActive(false);
            mStayTran.gameObject.SetActive(true);

            EventToUI.SetArg(UIEventArg.Arg1, gameObject);
            EventToUI.SetArg(UIEventArg.Arg2, string.Format("{0}x{1}", itemName, count));
            EventToUI.SetArg(UIEventArg.Arg3, (int)quality);
            EventToUI.SendEvent("EU_ADD_DROPITEMTEXT");

            CancelInvoke("PlayStayEfxObj");
        }
Ejemplo n.º 4
0
        private void OnEvent()
        {
            if (EventToUI.sEvent.CompareTo("EU_ADD_DROPITEMTEXT") == 0)
            {
                GameObject dropItemObj = (GameObject)EventToUI.GetArg(UIEventArg.Arg1);
                string     text        = (string)EventToUI.GetArg(UIEventArg.Arg2);
                int        quality     = (int)EventToUI.GetArg(UIEventArg.Arg3);
                if (-1 == quality)
                {
                    return;
                }

                Create(dropItemObj, text, quality);
            }
            else if (EventToUI.sEvent.CompareTo("EU_REMOVE_DROPITEMTEXT") == 0)
            {
                GameObject dropItemObj = (GameObject)EventToUI.GetArg(UIEventArg.Arg1);
                for (int i = 0; i < mDropTextList.Count; ++i)
                {
                    if (mDropTextList[i].dropItemObj == dropItemObj)
                    {
                        RecycleDropText(mDropTextList[i]);
                    }
                }
            }
            else if (EventToUI.sEvent.CompareTo("EU_SHOW_DROPFLY") == 0)
            {
                string  icon     = (string)EventToUI.GetArg(UIEventArg.Arg1);
                Vector3 from     = (Vector3)EventToUI.GetArg(UIEventArg.Arg2);
                Vector3 to       = (Vector3)EventToUI.GetArg(UIEventArg.Arg3);
                string  itemName = (string)EventToUI.GetArg(UIEventArg.Arg4);
                int     quality  = (int)EventToUI.GetArg(UIEventArg.Arg5);

                ShowDropFlyItem(Time.realtimeSinceStartup, icon, from, to, itemName, quality);
            }
            else if (EventToUI.sEvent.CompareTo("EU_SHOW_DROPGOLDGFLY") == 0)
            {
                int     count = (int)EventToUI.GetArg(UIEventArg.Arg1);
                Vector3 pos   = (Vector3)EventToUI.GetArg(UIEventArg.Arg2);

                ShowDropGoldFlyItem(count, pos);
            }
            else if (EventToUI.sEvent.CompareTo("EU_SHOW_DROPFLYTIP") == 0)
            {
                FlyTipInfo info = new FlyTipInfo();

                info.name    = (string)EventToUI.GetArg(UIEventArg.Arg1);
                info.quality = (int)EventToUI.GetArg(UIEventArg.Arg2);

                mProcessFlyTips.Enqueue(info);
            }
        }
Ejemplo n.º 5
0
        void OnEvent()
        {
            if (EventToUI.sEvent.CompareTo("EU_DEBUGLOGOUT") == 0)
            {
                LOG_TYPE type   = (LOG_TYPE)EventToUI.GetArg(UIEventArg.Arg1);
                string   strMsg = (string)EventToUI.GetArg(UIEventArg.Arg2);

                LogToBuff(DEBUG_TYPE.DEBUG_LOG, type, strMsg);
            }
            else if (EventToUI.sEvent.CompareTo("EU_GMOP_OK") == 0)
            {
                outPutAppend("gm操作成功!");
            }
        }
Ejemplo n.º 6
0
        public override void InitializeSrv()
        {
            uiCamera = MainPanelMgr.Instance.uiCamera;

            CoreEntry.gEventMgr.AddListener(GameEvent.GE_AFTER_LOADSCENE, OnBeginSceneLoad);
            CoreEntry.gEventMgr.AddListener(GameEvent.GE_BEGIN_LOADSCENE, OnBeginSceneLoad);
            CoreEntry.gEventMgr.AddListener(GameEvent.GE_BEGIN_LOADSCENE_LOGIN, OnBeginSceneLoad);
            CoreEntry.gEventMgr.AddListener(GameEvent.GE_BEGIN_LOADSCENE_CREATE_ROLE, OnBeginSceneLoad);
            EventToUI.RegisterEvent("EU_ADD_DROPITEMTEXT", OnEvent);
            EventToUI.RegisterEvent("EU_REMOVE_DROPITEMTEXT", OnEvent);
            EventToUI.RegisterEvent("EU_SHOW_DROPFLY", OnEvent);
            EventToUI.RegisterEvent("EU_SHOW_DROPGOLDGFLY", OnEvent);
            EventToUI.RegisterEvent("EU_SHOW_DROPFLYTIP", OnEvent);
        }
Ejemplo n.º 7
0
        // Use this for initialization
        void Start()
        {
            CancelInvoke("Start");
            //m_skillBase = this.transform.root.gameObject.GetComponent<SkillBase>();
            if (m_skillBase == null || m_skillBase.m_actor == null)
            {
                return;
            }

            m_prepareKeepTime = m_skillBase.prepareKeepTime;

            if (m_attackBreakDesc == null)
            {
                return;
            }

            if (m_attackBreakDesc.breakDamageHP <= 0)
            {
                return;
            }
            m_breakDamageHP = m_attackBreakDesc.breakDamageHP;

            //开始等待伤害
            m_hadDamageValue = 0;

            //注册事件
            RegisterEvent();

            if (m_attackBreakDesc.isUsedUI)
            {
                EventToUI.SetArg(UIEventArg.Arg1, 1f);
                EventToUI.SetArg(UIEventArg.Arg2, m_prepareKeepTime);
                EventToUI.SendEvent("EU_DPSBAR_SHOW");

                m_updateCount = 0;
                InvokeRepeating("UpdateShowTime", 1, 1);
            }


            //加载UI
            //if (m_attackBreakDesc.UIPrefabPath.Length <= 0)
            //{
            //    return;
            //}

            //m_damageUIObj = Instantiate(
            //        CoreEntry.gResLoader.LoadResource(m_attackBreakDesc.UIPrefabPath)) as GameObject;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 回收拾取
        /// </summary>
        /// <param name="item"></param>
        private void RecycleDropFlyItem(DropFlyItem item, bool isDone = false)
        {
            //item.gameObject.SetActive(false);
            item.gameObject.transform.SetRenderActive(false);
            mDropFlyItemList.Remove(item);
            mCachedFlyItemList.Add(item);

            if (isDone)
            {
                DoBagTween();

                EventToUI.SetArg(UIEventArg.Arg1, item.mItemName);
                EventToUI.SetArg(UIEventArg.Arg2, item.mItemQuality);
                EventToUI.SendEvent("EU_SHOW_DROPFLYTIP");
            }
        }
Ejemplo n.º 9
0
        void UpdateShowTime()
        {
            m_updateCount++;

            float diffTime = m_prepareKeepTime - m_updateCount;

            if (diffTime < 0)
            {
                diffTime = 0;
            }

            diffTime = Mathf.Floor(diffTime);

            EventToUI.SetArg(UIEventArg.Arg1, diffTime);
            EventToUI.SendEvent("EU_DPSBAR_SET_TIME_VAULE");
        }
Ejemplo n.º 10
0
        void EventFunction(GameEvent ge, EventParameter parameter)
        {
            switch (ge)
            {
            case GameEvent.GE_DAMAGE_CHANGE:
            {
                int entityID = parameter.intParameter;
                if (entityID != m_skillBase.m_actor.entityid)
                {
                    return;
                }

                int hp = parameter.intParameter1;
                m_hadDamageValue += hp;
                //更新UI
                if (m_attackBreakDesc.isUsedUI)
                {
                    float ratio = (m_breakDamageHP - m_hadDamageValue) * 1.0f / m_breakDamageHP;
                    //LogMgr.UnityLog("ratio=" + ratio);
                    if (ratio < 0)
                    {
                        ratio = 0;
                    }

                    EventToUI.SetArg(UIEventArg.Arg1, ratio);
                    EventToUI.SendEvent("EU_DPSBAR_SET_PERCENT_VAULE");
                }

                //是否达到目标伤害
                if (m_hadDamageValue >= m_breakDamageHP)
                {
                    UnRegisterEvent();

                    OnBreakSkill();
                }
            }
            break;

            default:
                break;
            }
        }
Ejemplo n.º 11
0
        /// <summary>
        /// 回收掉落物品
        /// </summary>
        /// <param name="unusedDropItem"></param>
        private void ReleaseDropItem(DropItemInfo unusedDropItem)
        {
            EventToUI.SetArg(UIEventArg.Arg1, unusedDropItem.dropItemObj);
            EventToUI.SendEvent("EU_REMOVE_DROPITEMTEXT");

            GameObjectPool objPool = m_moneyEftObjectPool;

            if (unusedDropItem.dropType == DROP_TYPE.DROPTYPE_COMMON)
            {
                objPool = m_itemEftPoolDict[unusedDropItem.dropEft];
            }

            if (null != unusedDropItem.dropQualityEftObj)
            {
                CoreEntry.gGameObjPoolMgr.Destroy(unusedDropItem.dropQualityEftObj);
            }

            if (unusedDropItem.dropItemObj != null)
            {
                objPool.RecyclePrefabInstance(unusedDropItem.dropItemObj);
                unusedDropItem.dropItemObj = null;
            }
            m_UnusedDropItemList.Add(unusedDropItem);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// 拾取特效
        /// </summary>
        /// <param name="dropItem"></param>
        private void PlayPickEffect(DropItemInfo dropItem)
        {
            if (dropItem.dropType == DROP_TYPE.DROPTYPE_GOLD)
            {
                EventToUI.SetArg(UIEventArg.Arg1, dropItem.count);
                EventToUI.SetArg(UIEventArg.Arg2, dropItem.dropPosition);
                EventToUI.SendEvent("EU_SHOW_DROPGOLDGFLY");

                CoreEntry.gAudioMgr.PlayUISound(900014);

                return;
            }

            LuaTable itemCfg  = null;
            LuaTable equipCfg = null;

            itemCfg = ConfigManager.Instance.BagItem.GetItemConfig(dropItem.cfgID);
            if (null == itemCfg)
            {
                equipCfg = ConfigManager.Instance.BagItem.GetItemConfig(dropItem.cfgID);
            }

            if (null == itemCfg && null == equipCfg)
            {
                return;
            }

            string dmeshid  = string.Empty;
            string itemName = string.Empty;
            int    quality  = -1;

            if (null != itemCfg)
            {
                dmeshid  = itemCfg.Get <string>("dmeshid");
                itemName = itemCfg.Get <string>("name");
                quality  = itemCfg.Get <int>("quality");
            }
            else
            {
                if (equipCfg != null)
                {
                    dmeshid  = equipCfg.Get <string>("dmeshid");
                    itemName = equipCfg.Get <string>("name");
                    quality  = equipCfg.Get <int>("quality");
                }
            }

            string[] strs = dmeshid.Split('#');
            if (strs == null || strs.Length != 2)
            {
                return;
            }

            EventToUI.SetArg(UIEventArg.Arg1, strs[0]);
            EventToUI.SetArg(UIEventArg.Arg2, dropItem.dropPosition);
            Transform t = PickFlyTarget;

            if (null != t)
            {
                EventToUI.SetArg(UIEventArg.Arg3, t.position);
            }
            else
            {
                EventToUI.SetArg(UIEventArg.Arg3, Vector3.zero);
            }
            EventToUI.SetArg(UIEventArg.Arg4, string.Format("{0} x{1}", itemName, dropItem.count));
            EventToUI.SetArg(UIEventArg.Arg5, quality);
            EventToUI.SendEvent("EU_SHOW_DROPFLY");

            //if (m_pickEftObjectPool != null)
            //{
            //    GameObject pickFlyObj = m_pickEftObjectPool.ObtainPrefabInstance();
            //    if (pickFlyObj != null)
            //    {
            //        pickFlyObj.SetActive(true);
            //        DropPickFly pickFly = pickFlyObj.GetComponent<DropPickFly>();
            //        ActorObj po = CoreEntry.gActorMgr.GetPlayerActorByServerID(MainRole.Instance.serverID);
            //        //pickFly.Init(dropItem.dropPosition, po.gameObject, m_pickEftObjectPool);
            //        pickFly.Init(dropItem.dropPosition, m_BagUIPos, m_pickEftObjectPool);
            //    }
            //}
        }