示例#1
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);
    }