예제 #1
0
    public void SetTabMoveInfoForMobile(bool bStart, eCharAnimationType anitype)
    {
        NrCharUser    nrCharUser    = this.m_pkChar as NrCharUser;
        Nr3DCharActor nr3DCharActor = nrCharUser.Get3DChar() as Nr3DCharActor;

        if (nr3DCharActor == null)
        {
            return;
        }
        if (bStart)
        {
            this.ProcessIncreaseMove();
            this.SetCharPos(nr3DCharActor.GetRootGameObject());
            this.SendCharMovePacketForKeyBoardMove(false);
            this.m_bArrived      = false;
            this.m_bKeyboardMove = false;
            this.m_bMouseMove    = false;
            this.m_bJoyStickMove = true;
        }
        else
        {
            this.MoveStop(false, false);
        }
        nrCharUser.SetAnimation(anitype);
    }
예제 #2
0
    public void SetSwitchPart(NrCharDefine.eAT2PartAssetBundle partindex, string filename)
    {
        Nr3DCharActor nr3DCharActor = this.m_pkTarget3DChar as Nr3DCharActor;

        if (nr3DCharActor == null)
        {
            return;
        }
        nr3DCharActor.SetSwitchPart(partindex, filename);
    }
예제 #3
0
    private void ChangeBodyPart(int _BodyStyle)
    {
        Nr3DCharActor nr3DCharActor = this.m_kCreateChar.Get3DChar() as Nr3DCharActor;

        if (nr3DCharActor == null)
        {
            return;
        }
        nr3DCharActor.RemoveItemAll();
    }
예제 #4
0
    public void KeyboardMove()
    {
        if (!NrTSingleton <NkClientLogic> .Instance.IsMovable())
        {
            return;
        }
        if (!this.m_pkChar.IsMovingAnimation())
        {
            return;
        }
        NrCharUser nrCharUser = this.m_pkChar as NrCharUser;

        if (nrCharUser == null || !nrCharUser.IsReady3DModel())
        {
            return;
        }
        Nr3DCharActor nr3DCharActor = nrCharUser.Get3DChar() as Nr3DCharActor;

        if (nr3DCharActor == null)
        {
            return;
        }
        Transform transform = Camera.main.transform;
        Vector3   a         = transform.TransformDirection(Vector3.forward);

        a.y = 0f;
        a   = a.normalized;
        Vector3 a2       = new Vector3(a.z, 0f, -a.x);
        float   axisRaw  = NkInputManager.GetAxisRaw("Vertical");
        float   axisRaw2 = NkInputManager.GetAxisRaw("Horizontal");
        Vector3 vector   = axisRaw2 * a2 + axisRaw * a;
        Vector3 vector2  = Vector3.zero;

        if (vector != Vector3.zero)
        {
            float num = 0.3f;
            vector2 = Vector3.RotateTowards(vector2, vector, num * 0.0174532924f * Time.deltaTime, 1f);
            if (this.IsMovableArea(this.m_vCharPos.x + vector2.x, this.m_vCharPos.z + vector2.z) != NrCharDefine.eMoveTargetReason.MTR_SUCCESS && !this.FindMovableAreaByKey(ref vector2))
            {
                return;
            }
            vector2 = vector2.normalized;
        }
        if (vector2 == Vector3.zero)
        {
            return;
        }
        this.ProcessIncreaseMove();
        nr3DCharActor.KeyboardMove(vector2, true);
        this.SetCharPos(nr3DCharActor.GetRootGameObject());
        this.SendCharMovePacketForKeyBoardMove(false);
        this.m_bArrived      = false;
        this.m_bKeyboardMove = true;
        this.m_bMouseMove    = false;
    }
예제 #5
0
    public void ResetBaseBone()
    {
        Nr3DCharActor nr3DCharActor = this.m_pkTarget3DChar as Nr3DCharActor;

        if (this.m_pkTarget3DChar == null)
        {
            return;
        }
        nr3DCharActor.SetBase();
        if (this.m_bOnlyWeaponControl)
        {
            nr3DCharActor.Reset();
            return;
        }
        if (!TsPlatform.IsMobile)
        {
            this.SetCharPart(NrCharDefine.eAT2CharPartInfo.CHARPART_HELMET);
            this.SetCharPart(NrCharDefine.eAT2CharPartInfo.CHARPART_BODY);
            this.SetCharPart(NrCharDefine.eAT2CharPartInfo.CHARPART_GLOVE);
            this.SetCharPart(NrCharDefine.eAT2CharPartInfo.CHARPART_BOOTS);
        }
        this.SetWeaponEquipItem();
        nr3DCharActor.Reset();
    }
예제 #6
0
    public void ProcessBundleCallBack(IDownloadedItem wItem, object kParamObj)
    {
        if (wItem == null || kParamObj == null)
        {
            return;
        }
        NkBundleParam nkBundleParam = kParamObj as NkBundleParam;
        string        bundleKey     = nkBundleParam.GetBundleKey();

        if (!wItem.canAccessAssetBundle)
        {
            switch (nkBundleParam.GetBundleType())
            {
            case NkBundleParam.eBundleType.BUNDLE_CHAR_BONE:
            case NkBundleParam.eBundleType.BUNDLE_CHAR_BONEPRELOAD:
            case NkBundleParam.eBundleType.BUNDLE_CHAR_SWITCHPART:
            case NkBundleParam.eBundleType.BUNDLE_CHAR_ATTACHPART:
            case NkBundleParam.eBundleType.BUNDLE_CHAR_ATTACHITEM:
            case NkBundleParam.eBundleType.BUNDLE_CHAR_RIDE:
            case NkBundleParam.eBundleType.BUNDLE_CHAR_NONEPART:
            case NkBundleParam.eBundleType.BUNDLE_CHAR_OBJECT:
            {
                if (nkBundleParam.GetBundleType() == NkBundleParam.eBundleType.BUNDLE_CHAR_BONEPRELOAD)
                {
                    this.m_fPreloadCount -= 1f;
                }
                int          id           = int.Parse(bundleKey);
                Nr3DCharBase nr3DCharBase = this.Get3DChar(id);
                if (nr3DCharBase == null)
                {
                    return;
                }
                bool itembundle = nkBundleParam.GetBundleType() == NkBundleParam.eBundleType.BUNDLE_CHAR_ATTACHITEM;
                nr3DCharBase.InitBundleLoadFailed(itembundle, wItem.indexParam);
                if (nkBundleParam.GetBundleType() == NkBundleParam.eBundleType.BUNDLE_CHAR_NONEPART || nkBundleParam.GetBundleType() == NkBundleParam.eBundleType.BUNDLE_CHAR_OBJECT)
                {
                    nr3DCharBase.Set3DCharLoadFailed(true);
                }
                if (Scene.IsCurScene(Scene.Type.SELECTCHAR))
                {
                    MsgHandler.Handle("SetCreateCharPartInfo", new object[]
                        {
                            true,
                            false
                        });
                }
                break;
            }
            }
            return;
        }
        WWWItem wWWItem = wItem as WWWItem;

        if (wWWItem != null)
        {
            wWWItem.SetIndexParam(nkBundleParam.GetNumParam());
            wWWItem.SetStringParam(nkBundleParam.GetStrParam());
        }
        switch (nkBundleParam.GetBundleType())
        {
        case NkBundleParam.eBundleType.BUNDLE_CHAR_BONE:
        case NkBundleParam.eBundleType.BUNDLE_CHAR_BONEPRELOAD:
            this.FinishDownloadAsync(wItem, nkBundleParam);
            if (nkBundleParam.GetBundleType() == NkBundleParam.eBundleType.BUNDLE_CHAR_BONEPRELOAD)
            {
                this.m_fPreloadCount -= 1f;
            }
            break;

        case NkBundleParam.eBundleType.BUNDLE_CHAR_ANIMATION:
            NrTSingleton <Nr3DCharSystem> .Instance.FinishDownloadAnimation(wItem);

            break;

        case NkBundleParam.eBundleType.BUNDLE_CHAR_SWITCHPART:
        {
            int           id2           = int.Parse(bundleKey);
            Nr3DCharActor nr3DCharActor = this.Get3DChar(id2) as Nr3DCharActor;
            if (nr3DCharActor == null)
            {
                return;
            }
            nr3DCharActor.FinishDownloadPart(ref wItem);
            break;
        }

        case NkBundleParam.eBundleType.BUNDLE_CHAR_ATTACHPART:
        case NkBundleParam.eBundleType.BUNDLE_CHAR_ATTACHITEM:
        {
            int          id3           = int.Parse(bundleKey);
            Nr3DCharBase nr3DCharBase2 = this.Get3DChar(id3);
            if (nr3DCharBase2 == null)
            {
                return;
            }
            nr3DCharBase2.FinishDownloadItem(ref wItem);
            break;
        }

        case NkBundleParam.eBundleType.BUNDLE_CHAR_RIDE:
        {
            int           id4            = int.Parse(bundleKey);
            Nr3DCharActor nr3DCharActor2 = this.Get3DChar(id4) as Nr3DCharActor;
            if (nr3DCharActor2 == null)
            {
                return;
            }
            nr3DCharActor2.FinishDownloadRide(ref wItem);
            break;
        }

        case NkBundleParam.eBundleType.BUNDLE_CHAR_NONEPART:
        case NkBundleParam.eBundleType.BUNDLE_CHAR_OBJECT:
        {
            int          id5           = int.Parse(bundleKey);
            Nr3DCharBase nr3DCharBase3 = this.Get3DChar(id5);
            if (nr3DCharBase3 == null)
            {
                return;
            }
            nr3DCharBase3.FinishDownloadBase(ref wItem);
            break;
        }

        case NkBundleParam.eBundleType.BUNDLE_UI_DIALOG:
        {
            int  indexParam = wItem.indexParam;
            Form form       = NrTSingleton <FormsManager> .Instance.GetForm((G_ID)indexParam);

            if (form == null)
            {
                return;
            }
            form.FinishDownloadBundle(ref wItem);
            break;
        }

        case NkBundleParam.eBundleType.BUNDLE_NORMAL_CALLBACK:
            nkBundleParam.funcCallBack(ref wItem);
            break;

        case NkBundleParam.eBundleType.BUNDLE_OBJECTPARAM_CALLBACK:
            nkBundleParam.funcParamCallBack(ref wItem, nkBundleParam.GetParamObject());
            break;

        default:
            return;
        }
    }
예제 #7
0
    public void MobileTabDragMove()
    {
        if (this.m_bKeyboardMove)
        {
            return;
        }
        if (!NrTSingleton <NkClientLogic> .Instance.IsMovable())
        {
            return;
        }
        if (!this.m_pkChar.IsMovingAnimation())
        {
            return;
        }
        NrCharUser nrCharUser = this.m_pkChar as NrCharUser;

        if (nrCharUser == null || !nrCharUser.IsReady3DModel())
        {
            return;
        }
        Nr3DCharActor nr3DCharActor = nrCharUser.Get3DChar() as Nr3DCharActor;

        if (nr3DCharActor == null)
        {
            return;
        }
        GameObject rootGameObject = nr3DCharActor.GetRootGameObject();

        if (rootGameObject == null)
        {
            return;
        }
        Transform transform = Camera.main.transform;
        Vector3   vector    = transform.TransformDirection(Vector3.forward);

        vector.y = 0f;
        vector   = vector.normalized;
        Vector3 vector2 = vector;
        Vector3 vector3 = Vector3.zero;

        if (vector2 != Vector3.zero)
        {
            float num = 0.3f;
            vector3 = Vector3.RotateTowards(vector3, vector2, num * 0.0174532924f * Time.deltaTime, 1f);
            if (this.IsMovableArea(this.m_vCharPos.x + vector3.x, this.m_vCharPos.z + vector3.z) != NrCharDefine.eMoveTargetReason.MTR_SUCCESS && !this.FindMovableAreaByKey(ref vector3))
            {
                return;
            }
            vector3 = vector3.normalized;
        }
        if (vector3 == Vector3.zero)
        {
            return;
        }
        this.ProcessIncreaseMove();
        nr3DCharActor.KeyboardMove(vector3, true);
        this.SetCharPos(nr3DCharActor.GetRootGameObject());
        this.SendCharMovePacketForKeyBoardMove(false);
        this.m_bArrived      = false;
        this.m_bKeyboardMove = false;
        this.m_bMouseMove    = true;
    }