コード例 #1
0
    void CreateCharacterDetailUIEnterBtnUp()
    {
        #region ���ƴ���

        //if (m_lastSelectedCharacter.vocation == (int)Vocation.Archer)
        //// || m_lastSelectedCharacter.vocation == (int)Vocation.Mage)
        //{
        //    return;
        //}

        #endregion

        string characterName = NewLoginUIViewManager.Instance.GetCharacterNameInputText();
        if (string.IsNullOrEmpty(characterName))
        {
            MogoMessageBox.RespError(LangOffset.Character, (int)CharacterCode.INPUT_NAME);
            return;
        }
        var isMatch = System.Text.RegularExpressions.Regex.IsMatch(characterName, @"[\s]+") ||
                      characterName.Contains(@"\") ||
                      characterName.Contains(@"/") ||
                      characterName.Contains(@"[") ||
                      characterName.Contains(@"]");
        Debug.Log("characterName: " + characterName + " isMatch: " + isMatch);
        if (isMatch)
        {
            MogoMessageBox.RespError(LangOffset.Character, (int)CharacterCode.INVALID_NAME);
            return;
        }

        EventDispatcher.TriggerEvent <string, byte, byte>(Events.UIAccountEvent.OnCreateCharacter, characterName, 1, (byte)m_lastSelectedCharacter.vocation);
        GameProcManager.SetGameProgress(ProcType.CreateCharacter, "ChreateCharacter");
    }
コード例 #2
0
    protected void Teleport()
    {
        // EventDispatcher.TriggerEvent<uint>(Events.GearEvent.Teleport, ID);
        if (autoProcess)
        {
            autoProcess = false;
            EventDispatcher.TriggerEvent(Events.GearEvent.TrapBegin, gearType);
        }

        teleportTimer = TimerHeap.AddTimer(20, 0, () =>
        {
            #region 进度记录

            GameProcManager.ClientTeleport(MogoWorld.thePlayer.CurMissionID, MogoWorld.thePlayer.CurMissionLevel, (int)ID);

            #endregion

            player.transform.position = desGear.transform.position;
            if (camIsFollow)
            {
                if (camIsSpin)
                {
                    MogoMainCamera.Instance.ChangeLockSightData(distance, rotationY, rotationX, cameraTime, cameraTime, false);
                }
                else
                {
                    MogoMainCamera.Instance.CloseToTarget(player.transform.FindChild("slot_camera"), MogoMainCamera.Instance.m_distance, MogoMainCamera.Instance.m_rotationY, MogoMainCamera.Instance.m_rotationX, cameraTime, cameraTime, MogoMainCamera.Instance.LockSight);
                }
            }
        });
    }
コード例 #3
0
ファイル: TaskManager.cs プロジェクト: mengtest/xxxxx
        // 对话结束,上交任务
        public void HandInTask(int taskID)
        {
            Debug.Log("HandInTask() " + taskID + "      " + curNPCID);

            // if (TaskData.dataMap[taskID].conditionType == 1)
            curNPCID = TaskData.dataMap[taskID].npc;

            #region 进度记录

            GameProcManager.HandInTask(taskID);

            #endregion

            theOwner.RpcCall("NPCReq", (uint)curNPCID, (uint)taskID, (uint)1);
        }
コード例 #4
0
ファイル: TaskManager.cs プロジェクト: isoundy000/ahzs-client
        // 对话结束,上交任务
        public void HandInTask(int taskID)
        {
            Mogo.Util.LoggerHelper.Debug("OnGoingToNextTask " + taskID + "      " + curNPCID);

            // if (TaskData.dataMap[taskID].conditionType == 1)
            curNPCID = TaskData.dataMap[taskID].npc;

            #region 进度记录

            GameProcManager.HandInTask(taskID);

            #endregion

            theOwner.RpcCall("NPCReq", (uint)curNPCID, (uint)taskID, (uint)1);
        }
コード例 #5
0
    void OnTeachUIFocusDown()
    {
        // Debug.LogError("OnTeachUIFocusDown");
        if (m_oriWidget != null)
        {
            Debug.Log(m_oriWidget.name);
            if (m_oriWidget.GetComponentsInChildren <MogoButton>(true).Length > 0)
            {
                m_oriWidget.GetComponentsInChildren <MogoButton>(true)[0].FakeClick();
            }

            if (m_oriWidget.GetComponentsInChildren <EquipTipBtn>(true).Length > 0)
            {
                m_oriWidget.GetComponentsInChildren <EquipTipBtn>(true)[0].FakeClick();
            }

            if (m_oriWidget.GetComponentsInChildren <ChallengeUIGrid>(true).Length > 0)
            {
                m_oriWidget.GetComponentsInChildren <ChallengeUIGrid>(true)[0].FakeIt();
            }

            if (m_oriWidget.GetComponentsInChildren <InsetUIEquipmentGrid>(true).Length > 0)
            {
                m_oriWidget.GetComponentsInChildren <InsetUIEquipmentGrid>(true)[0].FakeClick();
            }

            if (m_oriWidget.GetComponentsInChildren <ControlStick>(true).Length > 0)
            {
                m_oriWidget.GetComponentsInChildren <ControlStick>(true)[0].FakePress();

                MogoFXManager.Instance.ReleaseParticleAnim("ControllerFX");

                m_goFocusWidget.GetComponent <TeachUIFocusWidget>().OriWidget = m_oriWidget;

                ShowTeachUI(false);
                ShowFingerAnim(false);
                if (m_goFocusWidget != null)
                {
                    GameProcManager.GuideUI(m_goFocusWidget.name, MogoWorld.thePlayer.CurMissionID);
                }
                ShowTip(Vector3.zero, "", false);

                return;
            }

            if (m_oriWidget.GetComponentsInChildren <PackageItemBox>(true).Length > 0)
            {
                m_oriWidget.GetComponentsInChildren <PackageItemBox>(true)[0].FakeClick();
            }

            // Debug.LogError("Destroy OnTeachUIFocusDown");
            ShowTeachUI(false);
            ShowFingerAnim(false);
            if (m_goFocusWidget != null)
            {
                GameProcManager.GuideUI(m_goFocusWidget.name, MogoWorld.thePlayer.CurMissionID);
            }

            ShowTip(Vector3.zero, "", false);

            Destroy(m_goFocusWidget);

            m_bStartCount   = false;
            m_fAutoLastTime = 0f;
        }

        //m_goTeachUICamera.SetActive(false);
    }
コード例 #6
0
    /// <summary>
    /// ѡ�񴴽���ɫ
    /// </summary>
    /// <param name="go"></param>
    void OnCreateCharacterSelected(GameObject go, bool needFadeIn)
    {
        var vocation = Int32.Parse(go.name);

        #region ����

        var goAnimator = m_Animators[vocation];
        if (goAnimator != null)
        {
            goAnimator.SetInteger("Action", 35);
            actionTimer = TimerHeap.AddTimer(500, 0, () =>
            {
                if (go && goAnimator)
                {
                    goAnimator.SetInteger("Action", 34);
                }
            });
        }

        #endregion

        #region ��Ч

        switch (vocation)
        {
        case (int)Vocation.Warrior:
            if (m_sfxHandlers.ContainsKey(vocation) && m_fxTimes.ContainsKey(vocation))
            {
                foreach (var item in m_sfxHandlers)
                {
                    item.Value.RemoveAllFX();
                }

                foreach (var item in m_fxTimes)
                {
                    TimerHeap.DelTimer(item.Value);
                }

                m_sfxHandlers[vocation].HandleFx(10135);
                m_fxTimes[vocation] = TimerHeap.AddTimer(3000, 0, () =>
                {
                    if (m_sfxHandlers.ContainsKey(vocation))
                    {
                        m_sfxHandlers[vocation].RemoveAllFX();
                    }
                });
            }
            break;

        case (int)Vocation.Archer:
            if (m_sfxHandlers.ContainsKey(vocation) && m_fxTimes.ContainsKey(vocation))
            {
                foreach (var item in m_sfxHandlers)
                {
                    item.Value.RemoveAllFX();
                }

                foreach (var item in m_fxTimes)
                {
                    TimerHeap.DelTimer(item.Value);
                }

                m_sfxHandlers[vocation].HandleFx(10335);
                m_fxTimes[vocation] = TimerHeap.AddTimer(3000, 0, () =>
                {
                    if (m_sfxHandlers.ContainsKey(vocation))
                    {
                        m_sfxHandlers[vocation].RemoveAllFX();
                    }
                });
            }
            break;

        case (int)Vocation.Assassin:
            if (m_sfxHandlers.ContainsKey(vocation) && m_fxTimes.ContainsKey(vocation))
            {
                foreach (var item in m_sfxHandlers)
                {
                    item.Value.RemoveAllFX();
                }

                foreach (var item in m_fxTimes)
                {
                    TimerHeap.DelTimer(item.Value);
                }

                m_sfxHandlers[vocation].HandleFx(10435);
                m_fxTimes[vocation] = TimerHeap.AddTimer(3000, 0, () =>
                {
                    if (m_sfxHandlers.ContainsKey(vocation))
                    {
                        m_sfxHandlers[vocation].RemoveAllFX();
                    }
                });
            }
            break;


        case (int)Vocation.Mage:
            if (m_sfxHandlers.ContainsKey(vocation) && m_fxTimes.ContainsKey(vocation))
            {
                foreach (var item in m_sfxHandlers)
                {
                    item.Value.RemoveAllFX();
                }

                foreach (var item in m_fxTimes)
                {
                    TimerHeap.DelTimer(item.Value);
                }

                m_sfxHandlers[vocation].HandleFx(10235);
                m_sfxHandlers[vocation].HandleFx(10239, null, (fxgo, fxid) =>
                {
                    fxgo.transform.parent           = m_avatarList[vocation].gameObject.transform.Find("Bip_master/bip_weapon_separate/equip_mage_staff_02_p(Clone)");
                    fxgo.transform.localPosition    = Vector3.zero;
                    fxgo.transform.localEulerAngles = new Vector3(270, 0, 0);
                    fxgo.transform.localScale       = new Vector3(1, 1, 1);
                });

                m_fxTimes[vocation] = TimerHeap.AddTimer(3000, 0, () =>
                {
                    if (m_sfxHandlers.ContainsKey(vocation))
                    {
                        m_sfxHandlers[vocation].RemoveFXs(10235);
                    }
                });
            }
            break;

        default:
            break;
        }

        #endregion

        var cameraSlot = m_cameraSlots.GetValueOrDefault(vocation, null);
        m_loginCamera.SetTarget(cameraSlot);
        var avatar = m_avatarList.GetValueOrDefault(vocation, null);
        if (avatar == null)
        {
            return;
        }

        if (m_lastSelectedCharacter != null)
        {
            m_lastSelectedCharacter.Unfocus();
        }
        avatar.Focus();
        if (needFadeIn)
        {
            m_lastSelectedCharacter.FadeOut();
            avatar.FadeIn();
        }
        else
        {
            foreach (var item in m_avatarList)
            {
                if (item.Value != avatar)
                {
                    item.Value.FadeOut();
                }
            }
        }
        m_lastSelectedCharacter = avatar;
        NewLoginUIViewManager.Instance.ShowCreateCharacterDetailUI();
        var chrInfo = CharacterInfoData.dataMap.GetValueOrDefault(int.Parse(go.name), null);
        if (chrInfo != null)
        {
            NewLoginUIViewManager.Instance.SetCreateCharacterJobDetailName(LanguageData.dataMap[chrInfo.vocation].content);
            NewLoginUIViewManager.Instance.SetCreateCharacterJobDetailInfo(LanguageData.dataMap[chrInfo.discription].content);
            List <JobAttrGridData> listd = new List <JobAttrGridData>()
            {
                new JobAttrGridData()
                {
                    attrName = LanguageData.GetContent(46802), level = chrInfo.attack
                },
                new JobAttrGridData()
                {
                    attrName = LanguageData.GetContent(46803), level = chrInfo.defence
                },
                new JobAttrGridData()
                {
                    attrName = LanguageData.GetContent(46804), level = chrInfo.range
                },
            };

            NewLoginUIViewManager.Instance.FillJobAttrGridData(listd);
        }

        #region ��Ч

        SoundManager.PlaySoundByID(19);

        #endregion

        #region ���ƴ���

        switch (vocation)
        {
        case 1:
        case 2:
        case 4:
        case 3:
            NewLoginUIViewManager.Instance.SetEnterButtonLabel(LanguageData.GetContent(46800), true);
            NewLoginUIViewManager.Instance.ShowDiceAndName(true);
            NewLoginUIViewManager.Instance.SetCharacterNameInputText("");
            EventDispatcher.TriggerEvent <byte>(Events.UIAccountEvent.OnGetRandomName, (byte)avatar.vocation);
            break;


            //NewLoginUIViewManager.Instance.SetEnterButtonLabel(LanguageData.GetContent(46801), false);
            //NewLoginUIViewManager.Instance.ShowDiceAndName(false);
            // TO DO
            //NewLoginUIViewManager.Instance.SetCharacterNameInputText("");
            //EventDispatcher.TriggerEvent<byte>(Events.UIAccountEvent.OnGetRandomName, (byte)avatar.vocation);
            //break;
        }

        switch (vocation)
        {
        case 1:
            m_currentPos = 3;
            NewLoginUIViewManager.Instance.SelectCreateCharacterDetailUIJobIcon(3);
            break;

        case 2:
            m_currentPos = 4;
            NewLoginUIViewManager.Instance.SelectCreateCharacterDetailUIJobIcon(4);
            break;

        case 3:
            m_currentPos = 1;
            NewLoginUIViewManager.Instance.SelectCreateCharacterDetailUIJobIcon(1);
            break;

        case 4:
            m_currentPos = 2;
            NewLoginUIViewManager.Instance.SelectCreateCharacterDetailUIJobIcon(2);
            break;
        }

        #endregion
        GameProcManager.SetGameProgress(ProcType.CreateCharacter, "SelectCharacter");
    }