示例#1
0
        public static void ChangeMainPLayerObjToNormal()
        {
            Obj_MainPlayer main = Singleton <ObjManager> .Instance.MainPlayer;

            if (main == null)
            {
                LogModule.ErrorLog("ReloadMainPLayerObj called burt Singleton<ObjManager>.Instance.MainPlayer is null!");
                return;
            }
            Tab_ItemVisual tabItemVisual = TableManager.GetItemVisualByID(main.ModelVisualID, 0);

            if (tabItemVisual == null)
            {
                tabItemVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
                if (tabItemVisual == null)
                {
                    return;
                }
            }

            int nCharmodelID = main.GetCharModelID(tabItemVisual, main.Profession);

            Tab_CharModel charModel = TableManager.GetCharModelByID(nCharmodelID, 0);

            if (charModel == null)
            {
                return;
            }

            main.AnimationFilePath = charModel.AnimPath;
            main.ModelID           = nCharmodelID;
            LoadModelToRoot(nCharmodelID, EResourceType.CharacterModel,
                            LoadModelComplete, main.gameObject, charModel, false);
        }