示例#1
0
    void Update()
    {
        if (m_bShow)
        {
            if (m_firstShowTime > m_continueShowTime)
            {
                m_firstShowTime = 0;
                if (SkillBarLogic.Instance() != null)
                {
                    SkillBarLogic.Instance().UpdateSkillBarInfo();
                }
                UIManager.CloseUI(UIInfo.NewItemGetRoot);
                m_bShow = false;

                if (OpenServer.Instance())
                {
                    OpenServer.Instance().onClickOpenServer();
                }
                UIManager.CloseUI(UIInfo.OpenServer);
            }
            else
            {
                m_firstShowTime += Time.deltaTime;
            }
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_NOTICE_ADDED_FRIEND packet = (GC_NOTICE_ADDED_FRIEND)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            m_guid = packet.Guid;
            if (m_guid == GlobeVar.INVALID_GUID)
            {
                return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
            }

            string text = packet.Name + StrDictionary.GetClientDictionaryString("#{1072}");

            PlayerData playerdata = GameManager.gameManager.PlayerDataPool;

            playerdata.AddFriendVlue.m_guid    = packet.Guid;
            playerdata.AddFriendVlue.m_name    = packet.Name;
            playerdata.AddFriendVlue.m_fight   = packet.Fight;
            playerdata.AddFriendVlue.m_profess = packet.Prof;
            playerdata.AddFriendVlue.m_level   = packet.Level;

            if (OpenServer.Instance() == null || OpenServer.Instance().IsShow() == false)
            {
                UIManager.ShowUI(UIInfo.AddFriend);
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
示例#3
0
    public void CloseWindow()
    {
        UIManager.CloseUI(UIInfo.OtherRoleView);
        if (m_oPenType == OPEN_TYPE.OPEN_TYPE_FRIEND)
        {
            UIManager.ShowUI(UIInfo.RelationRoot);
        }
        if (m_oPenType == OPEN_TYPE.OPEN_TYPE_LASTSPEAKER)
        {
            UIManager.ShowUI(UIInfo.ChatInfoRoot);
        }

        if (m_oPenType == OPEN_TYPE.OPEN_TYPE_ADD_FRIEND_RET)
        {
            if (OpenServer.Instance() == null || OpenServer.Instance().IsShow() == false)
            {
                UIManager.ShowUI(UIInfo.AddFriend);
            }
        }
        m_oPenType = OPEN_TYPE.OPEN_TYPE_INVALID;
    }
示例#4
0
    void Init(string spriteName, GameObject destGameObject, NEWITEMTYPE type, int IntParam = GlobeVar.INVALID_ID, GameObject attachGameObject = null, string itemName = "", string strFuncName = "", string strDec = "")
    {
        _forShowWin();
        m_destGameObject = destGameObject;
        m_AttachItem.SetActive(false);
        hasAttachSkill = false;
        if (type == NEWITEMTYPE.TYPE_SKILL)
        {
            Dictionary <int, List <Tab_SkillActive> > dicTab_SkillActive = TableManager.GetSkillActive();

            foreach (KeyValuePair <int, List <Tab_SkillActive> > kv in dicTab_SkillActive)
            {
                Tab_SkillActive _skillActive = kv.Value[0];

                //有附带技能
                if (_skillActive.SkillId == IntParam && _skillActive.AttachSkillId != -1)
                {
                    m_AttachItem.SetActive(true);
                    m_NeedToShow           = true;
                    m_AttachItemIcon.atlas = SkillAtlas;


                    Tab_SkillEx _tabSkillEx = TableManager.GetSkillExByID(_skillActive.AttachSkillId, 0);
                    if (_tabSkillEx != null)
                    {
                        Tab_SkillBase _sttachSkillBase = TableManager.GetSkillBaseByID(_tabSkillEx.BaseId, 0);
                        if (_sttachSkillBase != null)
                        {
                            hasAttachSkill = true;
                            m_AttachItemIcon.spriteName = _sttachSkillBase.Icon;
                            m_AttachItemIcon.MakePixelPerfect();
                            m_AttachNameLabel.text = _sttachSkillBase.Name;
                            m_AttachDescLabel.text = _tabSkillEx.SkillDesc;
                            m_AttachItemIcon.gameObject.transform.localScale = Vector3.one;
                        }
                    }
                }
            }

            if (hasAttachSkill)
            {
                m_MainItem.transform.localPosition = new Vector3(12, -84, 0);
            }

            m_ItemIcon.atlas      = SkillAtlas;
            m_ItemIcon.spriteName = spriteName;
            //m_ItemIcon.MakePixelPerfect();
            m_SprTitle.spriteName = "Newjineng";// new skill

            Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(IntParam, 0);
            if (tabSkillEx != null)
            {
                Tab_SkillBase _skillBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0);
                if (_skillBase != null)
                {
                    m_NameLabel.text = _skillBase.Name;
                    m_DescLabel.text = tabSkillEx.SkillDesc;
                    m_ItemIcon.gameObject.transform.localScale = Vector3.one;
                }
            }
        }
        else if (type == NEWITEMTYPE.TYPE_MENUBAR)
        {
            m_ItemIcon.atlas      = MainMenuBarAtlas;
            m_ItemIcon.spriteName = spriteName;
            //m_ItemIcon.MakePixelPerfect();
            m_ItemIcon.gameObject.transform.localScale = Vector3.one;
            m_SprTitle.spriteName = "Newxitong";
            m_NameLabel.text      = strFuncName;
            m_DescLabel.text      = "      " + strDec;
            m_ItemName.text       = itemName;
        }
        else if (type == NEWITEMTYPE.TYPE_FUNCTION)
        {
            if (IntParam == m_openServerId)
            {
                _hideShowWin();
                // 开服奖励的单独对待
                OpenServer.fakeId          = 67;
                OpenServer.destroyCallBack = () =>
                {
                    if (FunctionButtonLogic.Instance() != null)
                    {
                        FunctionButtonLogic.Instance().ShowTweenPosition();
                    }
                };
                UIManager.ShowUI(UIInfo.OpenServer, (bSuccess, param) =>
                {
                    if (bSuccess && OpenServer.Instance() != null)
                    {
                        OpenServer.Instance().ShowRideDesc();
                    }
                });
            }
            else
            {
                m_ItemIcon.atlas      = MainUIAtlas;
                m_ItemIcon.spriteName = spriteName;
                m_ItemIcon.gameObject.SetActive(!string.IsNullOrEmpty(spriteName));
                m_ItemIcon.MakePixelPerfect();
                m_ItemIcon.gameObject.transform.localScale = Vector3.one;
                m_SprTitle.spriteName = "Newxitong";
                m_NameLabel.text      = strFuncName;
                m_DescLabel.text      = "      " + strDec;
                m_ItemName.text       = itemName;
            }
        }
        else if (type == NEWITEMTYPE.TYPE_QINGGONG)
        {
            m_ItemIcon.atlas      = SkillAtlas;
            m_ItemIcon.spriteName = spriteName;
            m_ItemIcon.MakePixelPerfect();
            m_SprTitle.spriteName = "Newjineng";// new skill

            m_NameLabel.text = StrDictionary.GetClientDictionaryString("#{4584}");
            m_DescLabel.text = "      " + StrDictionary.GetClientDictionaryString("#{4586}");
            m_ItemIcon.gameObject.transform.localScale = 0.7f * Vector3.one;
        }
        else if (type == NEWITEMTYPE.TYPE_FELLOW3DSHOW)
        {
            _hideShowWin();
//            Transform parent = m_ItemIcon.transform.parent;
            m_ItemIcon.atlas = null;
            m_ItemIcon.transform.parent.FindChild("BGSprite").GetComponent <UISprite>().atlas = null;
            m_ItemIcon.transform.parent.FindChild("Sprite").GetComponent <UISprite>().atlas   = null;
            OpenServer.fakeId          = 79;
            OpenServer.destroyCallBack = () =>
            {
                NewItemOnClick();
            };
            UIManager.ShowUI(UIInfo.OpenServer, (bSuccess, param) =>
            {
                if (bSuccess && OpenServer.Instance() != null)
                {
                    OpenServer.Instance().ShowFellowDesc();
                }
            });
        }

        m_ItemTween.Reset();
        m_ItemTween.gameObject.SetActive(false);

        if (hasAttachSkill)
        {
            m_AttachItemTween.Reset();
            if (attachGameObject != null)
            {
                m_AttachItemTween.to = m_AttachItemTween.gameObject.transform.parent.InverseTransformPoint(attachGameObject.transform.position);
            }
        }

        m_ItemType = type;
        m_IntParam = IntParam;
    }