Exemple #1
0
    public bool MakeCharStatus(eCharKindType chartype, GameObject pkCharStatus, float fScale)
    {
        this.SyncBillboardRotate(true);
        if (!this.CreateCharStatus())
        {
            return(false);
        }
        pkCharStatus.transform.parent        = this.m_pkCharStatus.transform;
        pkCharStatus.transform.localPosition = Vector3.zero;
        pkCharStatus.transform.localRotation = Quaternion.identity;
        pkCharStatus.transform.localScale    = new Vector3(fScale, fScale, fScale);
        bool showHeadUp = this.IsCheckShowHeadUp(chartype);

        this.SetShowHeadUp(showHeadUp);
        return(true);
    }
Exemple #2
0
    public int SetChar(BATTLE_SOLDIER_INFO MakeCharInfo)
    {
        if (MakeCharInfo == null)
        {
            return(-1);
        }
        NrCharKindInfo charKindInfo = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfo(MakeCharInfo.CharKind);

        NrPersonInfoBattle nrPersonInfoBattle = new NrPersonInfoBattle();

        if (charKindInfo != null)
        {
            eCharKindType charKindType = (eCharKindType)MakeCharInfo.CharKindType;
            nrPersonInfoBattle.SetUserData(MakeCharInfo);
            return(this.SetChar(MakeCharInfo.CharUnique, MakeCharInfo.BUID, MakeCharInfo.CharKind, charKindType, nrPersonInfoBattle, MakeCharInfo.Speed, ref MakeCharInfo.kPartInfo, MakeCharInfo.SolIndex));
        }
        Debug.LogWarning("CharKind not found !!!!! Name = " + nrPersonInfoBattle.GetCharName() + ", Kind = " + MakeCharInfo.CharKind.ToString());
        return(-1);
    }
    public override eCharAnimationType GetIdleAnimation()
    {
        eCharAnimationType eCharAnimationType = eCharAnimationType.Stay1;

        if (base.IsBattleChar())
        {
            return(this.m_pkBattleChar.GetStayAni());
        }
        NrCharBase parentChar = base.GetParentChar();

        if (parentChar != null && !parentChar.IsSubChar)
        {
            eCharKindType charKindType = parentChar.GetCharKindType();
            if (charKindType == eCharKindType.CKT_NPC)
            {
                if (parentChar.LoadAfterAnimation != eCharAnimationType.TalkStart1 && parentChar.LoadAfterAnimation != eCharAnimationType.TalkStay1)
                {
                    eCharAnimationType = eCharAnimationType.EcoAction1;
                }
                if (!base.IsHaveAnimation(eCharAnimationType))
                {
                    eCharAnimationType = eCharAnimationType.Stay1;
                }
                NrCharKindInfo charKindInfoFromCode = NrTSingleton <NrCharKindInfoManager> .Instance.GetCharKindInfoFromCode(base.GetCharCode());

                if (charKindInfoFromCode != null && charKindInfoFromCode.IsATB(1125899906842624L))
                {
                    eCharAnimationType = eCharAnimationType.Stay1;
                    if (!base.IsHaveAnimation(eCharAnimationType))
                    {
                        eCharAnimationType = eCharAnimationType.BStay1;
                    }
                }
            }
        }
        return(eCharAnimationType);
    }
Exemple #4
0
    public int SetChar(short charunique, short buid, int charkind, eCharKindType kindtype, NrPersonInfoBase kPersonInfo, float speed, ref NrCharPartInfo pkPartInfo, byte nsolidx)
    {
        int          num   = this.AddNewChar(charunique, buid);
        NkBattleChar @char = this.GetChar(num);

        if (@char != null)
        {
            @char.SetKindType(kindtype);
            @char.SetPersonInfo(kPersonInfo);
            NrCharBase char2 = NrTSingleton <NkCharManager> .Instance.GetChar(1);

            if (charunique == char2.GetCharUnique() && !NrTSingleton <NkBattleReplayManager> .Instance.IsReplay)
            {
                @char.MyChar = true;
                @char.SetSolIdx((short)nsolidx);
            }
            if (kindtype == eCharKindType.CKT_USER && charunique != char2.GetCharUnique())
            {
                @char.ChangeCharPartInfo(pkPartInfo, true, true);
                @char.SetReadyPartInfo();
            }
            if (speed > 0f)
            {
                NrPersonInfoBase personInfo = @char.GetPersonInfo();
                if (personInfo != null)
                {
                    personInfo.SetMoveSpeed(speed);
                }
            }
            if (kindtype == eCharKindType.CKT_NPC && @char.GetCurrentOrder() == eBATTLE_ORDER.eBATTLE_ORDER_MOVE)
            {
                @char.MoveTo(kPersonInfo.GetDirection().x, kPersonInfo.GetDirection().y, kPersonInfo.GetDirection().z, false);
            }
        }
        return(num);
    }
    public void Init(string charcode, Nr3DCharBase k3DChar, eCharKindType chartype)
    {
        this.m_szCharCode = charcode;
        switch (chartype)
        {
        case eCharKindType.CKT_USER:
            this.m_pkParent3DChar = (k3DChar as Nr3DCharActor);
            break;

        case eCharKindType.CKT_SOLDIER:
        case eCharKindType.CKT_MONSTER:
        case eCharKindType.CKT_NPC:
            this.m_pkParent3DChar = (k3DChar as Nr3DCharNonePart);
            break;

        case eCharKindType.CKT_OBJECT:
            this.m_pkParent3DChar = (k3DChar as Nr3DCharObject);
            break;

        default:
            this.m_pkParent3DChar = k3DChar;
            break;
        }
        this.m_eCurrentAniType = eCharAnimationType.Stay1;
        this.m_ePrevAniType    = eCharAnimationType.Stay1;
        this.m_bLoop           = false;
        this.m_eNextAniTypeList.Clear();
        this.m_bProcessStatus        = true;
        this.m_nSetAniCount          = 0;
        this.m_bFinishAnimationFrame = false;
        this.m_bBattleState          = false;
        this.m_CurrentAniState       = null;
        this.m_fAniPlayingTime       = 0f;
        this.m_fAnimationLength      = 0f;
        this.AttachFacialAnimation();
    }
Exemple #6
0
 public bool IsCheckShowHeadUp(eCharKindType chartype)
 {
     return(!NrTSingleton <NkClientLogic> .Instance.IsNPCTalkState() && (this.m_bBattleChar || !NrTSingleton <NkClientLogic> .Instance.IsBattleScene()) && !this.m_bBattleChar && !this.m_bSubChar && chartype != eCharKindType.CKT_MONSTER && chartype != eCharKindType.CKT_OBJECT);
 }
Exemple #7
0
    public void MakeCharGuild(eCharKindType chartype, long i64GuildID, string strGuildName, bool bGuildWar, bool ridestate)
    {
        if (this.m_pkHeadUpRoot == null)
        {
            return;
        }
        this.DisposeGameObject(this.m_pkGuildSprite);
        if (this.m_pkGuildSprite == null)
        {
            this.m_pkGuildSprite = CResources.ADDPrefabLoad(this.m_pkHeadUpRoot, NrTSingleton <UIDataManager> .Instance.FilePath + "Prefabs/CharName");
            if (this.m_pkGuildSprite != null)
            {
                CharNameBillboardSprite component = this.m_pkGuildSprite.GetComponent <CharNameBillboardSprite>();
                if (component == null)
                {
                    TsLog.LogWarning("!!!!!!!!!!!!!!!!!!!!! m_pkGuildSprite NULL ", new object[0]);
                    return;
                }
                component.Init();
                if (strGuildName.Length != 0)
                {
                    string str = string.Empty;
                    if (bGuildWar)
                    {
                        str = NrTSingleton <CTextParser> .Instance.GetTextColor("1401");
                    }
                    else
                    {
                        str = NrTSingleton <CTextParser> .Instance.GetTextColor("2005");
                    }
                    component.SetText(str + strGuildName);
                    component.SetTextSize(12f);
                    this.MakeCharGuildRank(component);
                    if (i64GuildID != 0L)
                    {
                        string guildPortraitURL = NrTSingleton <NkCharManager> .Instance.GetGuildPortraitURL(i64GuildID);

                        WebFileCache.RequestImageWebFile(guildPortraitURL, new WebFileCache.ReqTextureCallback(this.ReqWebImageCallback), component);
                    }
                    else
                    {
                        Transform transform = component.transform.FindChild("CharRank");
                        if (transform != null)
                        {
                            DrawTexture drawTexture = (DrawTexture)transform.GetComponent(typeof(DrawTexture));
                            drawTexture.SetTexture(NrTSingleton <NewGuildManager> .Instance.GetGuildDefualtTexture());
                            component.ShowTextAndPlane(true, false, true);
                        }
                        else
                        {
                            component.ShowTextAndPlane(true, false, false);
                        }
                    }
                    this.m_kTempVector3.x = 0f;
                    this.m_kTempVector3.y = 2f;
                    this.m_kTempVector3.z = 0f;
                    this.m_pkGuildSprite.transform.localPosition = this.m_kTempVector3;
                }
                this.SyncBillboardRotate(true);
                bool showHeadUp = this.IsCheckShowHeadUp(chartype);
                this.SetShowHeadUp(showHeadUp);
            }
        }
    }
Exemple #8
0
    public bool MakeChat(eCharKindType chartype, string chatText, string guildName, bool ridestate, bool checkshowstatus)
    {
        if (chatText.Length <= 0)
        {
            return(false);
        }
        if (this.m_bCheckChatShowStatus && chartype == eCharKindType.CKT_NPC)
        {
            this.m_queueNpcTalk.Enqueue(chatText);
            return(false);
        }
        CharChatBillboardSprite charChatBillboardSprite = this.CreateChatSprite();

        if (charChatBillboardSprite == null)
        {
            return(false);
        }
        float num  = 2.2f;
        float num2 = 0f;

        charChatBillboardSprite.SetFontEffect(SpriteText.Font_Effect.HeadUp);
        switch (chartype)
        {
        case eCharKindType.CKT_USER:
        {
            string first = "[#FFFFFFFF]";
            charChatBillboardSprite.SetText(NrTSingleton <UIDataManager> .Instance.GetString(first, chatText));
            charChatBillboardSprite.SetPlaneKey("Win_T_BK", ref num2);
            if (ridestate)
            {
                num += 1.5f;
            }
            if (string.Empty != guildName)
            {
                num += 2f;
            }
            break;
        }

        case eCharKindType.CKT_SOLDIER:
        {
            string textColor = NrTSingleton <CTextParser> .Instance.GetTextColor("1002");

            charChatBillboardSprite.SetText(NrTSingleton <UIDataManager> .Instance.GetString(textColor, chatText));
            break;
        }

        case eCharKindType.CKT_MONSTER:
        {
            string textColor2 = NrTSingleton <CTextParser> .Instance.GetTextColor("1108");

            charChatBillboardSprite.SetText(textColor2 + chatText);
            break;
        }

        case eCharKindType.CKT_NPC:
        {
            char[] separator = new char[]
            {
                '+'
            };
            string[] array = chatText.Split(separator);
            if (this.m_bCheckChatShowStatus)
            {
                if (string.Empty != this.m_szColorText)
                {
                    for (int i = 0; i < array.Length; i++)
                    {
                        string @string = NrTSingleton <UIDataManager> .Instance.GetString(this.m_szColorText, array[i]);

                        this.m_queueNpcTalk.Enqueue(@string);
                    }
                }
                else
                {
                    for (int j = 0; j < array.Length; j++)
                    {
                        string string2 = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1404"), array[j]);

                        this.m_queueNpcTalk.Enqueue(string2);
                    }
                }
            }
            else
            {
                if (2 <= array.Length)
                {
                    if (string.Empty != this.m_szColorText)
                    {
                        string string3 = NrTSingleton <UIDataManager> .Instance.GetString(this.m_szColorText, array[0]);

                        charChatBillboardSprite.SetText(string3);
                        for (int k = 1; k < array.Length; k++)
                        {
                            string string4 = NrTSingleton <UIDataManager> .Instance.GetString(this.m_szColorText, array[k]);

                            this.m_queueNpcTalk.Enqueue(string4);
                        }
                    }
                    else
                    {
                        string string5 = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1404"), array[0]);

                        charChatBillboardSprite.SetText(string5);
                        for (int l = 1; l < array.Length; l++)
                        {
                            string string6 = NrTSingleton <UIDataManager> .Instance.GetString(NrTSingleton <CTextParser> .Instance.GetTextColor("1404"), array[l]);

                            this.m_queueNpcTalk.Enqueue(string6);
                        }
                    }
                }
                else if (string.Empty != this.m_szColorText)
                {
                    charChatBillboardSprite.SetText(this.m_szColorText + chatText);
                }
                else
                {
                    string textColor3 = NrTSingleton <CTextParser> .Instance.GetTextColor("1404");

                    charChatBillboardSprite.SetText(NrTSingleton <UIDataManager> .Instance.GetString(textColor3, chatText));
                }
                charChatBillboardSprite.SetPlaneKey("Win_T_BK", ref num2);
            }
            break;
        }
        }
        charChatBillboardSprite.ShowTextAndPlane(true, true);
        this.m_kTempVector3.x = 0f;
        this.m_kTempVector3.y = num + num2;
        this.m_kTempVector3.z = 0f;
        this.m_pkChatSprite.transform.localPosition = this.m_kTempVector3;
        this.m_fChatShowTime        = Time.time;
        this.m_bCheckChatShowStatus = checkshowstatus;
        this.SyncBillboardRotate(true);
        bool showHeadUp = this.IsCheckShowHeadUp(chartype);

        this.SetShowHeadUp(showHeadUp);
        return(true);
    }
Exemple #9
0
    public void MakeName(eCharKindType chartype, string strMark, string charname, bool ridestate)
    {
        bool flag = false;

        if (this.m_pkNameSprite == null)
        {
            flag = true;
        }
        CharNameBillboardSprite charNameBillboardSprite = this.CreateNameSprite();

        if (charNameBillboardSprite == null)
        {
            return;
        }
        float num = 0.3f;

        switch (chartype)
        {
        case eCharKindType.CKT_USER:
        {
            string textColor = NrTSingleton <CTextParser> .Instance.GetTextColor("1002");

            charNameBillboardSprite.SetText(textColor + charname);
            charNameBillboardSprite.SetTextSize(12f);
            if (ridestate)
            {
                num += 1.5f;
            }
            if (strMark.Length != 0)
            {
                this.MakeCharRank(strMark, charNameBillboardSprite, num);
                charNameBillboardSprite.ShowTextAndPlane(true, false, true);
            }
            else
            {
                charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            }
            break;
        }

        case eCharKindType.CKT_SOLDIER:
        {
            string textColor2 = NrTSingleton <CTextParser> .Instance.GetTextColor("1002");

            charNameBillboardSprite.SetText(textColor2 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            if (ridestate)
            {
                num += 1.5f;
            }
            break;
        }

        case eCharKindType.CKT_MONSTER:
        {
            string textColor3 = NrTSingleton <CTextParser> .Instance.GetTextColor("1404");

            charNameBillboardSprite.SetText(textColor3 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            break;
        }

        case eCharKindType.CKT_NPC:
        {
            string textColor4 = NrTSingleton <CTextParser> .Instance.GetTextColor("1404");

            charNameBillboardSprite.SetText(textColor4 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, false, false);
            break;
        }

        case eCharKindType.CKT_OBJECT:
        {
            string textColor5 = NrTSingleton <CTextParser> .Instance.GetTextColor("1205");

            charNameBillboardSprite.SetText(textColor5 + charname);
            charNameBillboardSprite.SetTextSize(12f);
            charNameBillboardSprite.ShowTextAndPlane(true, true, false);
            break;
        }
        }
        if (flag)
        {
            this.m_kTempVector3.x = 0f;
            this.m_kTempVector3.y = num;
            this.m_kTempVector3.z = 0f;
            this.m_pkNameSprite.transform.localPosition = this.m_kTempVector3;
        }
        this.SyncBillboardRotate(true);
        bool showHeadUp = this.IsCheckShowHeadUp(chartype);

        this.SetShowHeadUp(showHeadUp);
    }