public FMCFile Load(string file) { string file_no_ext = file; file += ".fmc"; FMCFile fi = null; if (FmcFile.ContainsKey(file)) { return(FmcFile[file]); } if (CombatData.Ins.Chapter != null) { string path = CombatData.Ins.Chapter.GetResPath(FileExt.Fmc, file_no_ext); if (!string.IsNullOrEmpty(path)) { fi = new FMCFile(); fi = fi.LoadFile(path); if (fi != null) { FmcFile.Add(file, fi); return(fi); } } } fi = new FMCFile(); fi = fi.LoadFile(file); if (fi != null) { FmcFile.Add(file, fi); } return(fi); }
public void Init(string file) { fmcFile = file; frames = FMCLoader.Instance.Load(fmcFile); pose = FMCPose.LoadPose(fmcFile); state = 1; //ChangePose(0, 0); }
public void Init(string file, FMCFile f = null) { fmcFile = file; frames = f != null ? f : FMCLoader.Ins.Load(fmcFile); pose = FMCPoseLoader.Ins.LoadPose(fmcFile); state = 1; //ChangePose(0, 0); }
public void Init(TextAsset asset) { int i = asset.name.IndexOf('.'); fmcFile = asset.name.Substring(0, i); frames = FMCLoader.Ins.Load(asset); pose = FMCPoseLoader.Ins.LoadPose(fmcFile); state = 1; }
public FMCFile Load(TextAsset asset) { if (FmcFile.ContainsKey(asset.name)) { return(FmcFile[asset.name]); } FMCFile fi = new FMCFile(); FMCFile ret = fi.LoadFile(asset); if (ret != null) { FmcFile.Add(asset.name, ret); } return(ret); }
public FMCFile Load(string file) { file += ".fmc"; if (FmcFile.ContainsKey(file)) { return(FmcFile[file]); } FMCFile fi = new FMCFile(); FMCFile ret = fi.LoadFile(file); if (ret != null) { FmcFile.Add(file, ret); } return(ret); }
public void Load(string file) { string s = file; if (!string.IsNullOrEmpty(file)) { //查看此物体属于什么,A:武器 B:道具 C:镖物 if (ItemInfo == null) { for (int i = 0; i < MenuResLoader.Ins.Info.Count; i++) { if (MenuResLoader.Ins.Info[i].model != "0" && 0 == string.Compare(MenuResLoader.Ins.Info[i].model, s, true)) { ApplyPrev(MenuResLoader.Ins.Info[i]); break; } string rh = s.ToUpper(); string rh2 = MenuResLoader.Ins.Info[i].model.ToUpper(); if (rh2.StartsWith(rh)) { s = MenuResLoader.Ins.Info[i].model; ApplyPrev(MenuResLoader.Ins.Info[i]); break; } } //不是一个Meteor.res里的物件 if (ItemInfo == null) { List <ItemData> its = DataMgr.Ins.GetItemDatas(); for (int i = 0; i < its.Count; i++) { if (its[i].MainType == (int)UnitType.Weapon) { WeaponData weapon = U3D.GetWeaponProperty(its[i].UnitId); if (weapon.WeaponR == s) { ItemInfoEx = its[i]; break; } } } } } //证明此物品不是可拾取物品 //gameObject.layer = (ItemInfo != null || ItemInfoEx != null) ? LayerManager.Trigger : LayerManager.Scene; gameObject.layer = LayerManager.Trigger; root.gameObject.layer = gameObject.layer; //箱子椅子桌子酒坛都不允许为场景物品. Utility.ShowMeteorObject(s, root); DesFile fIns = DesLoader.Ins.Load(s); //把子物件的属性刷到一起. for (int i = 0; i < fIns.SceneItems.Count; i++) { LoadCustom(fIns.SceneItems[i].name, fIns.SceneItems[i].custom); } //雪人不能合并材质,不然没法动画 if (CombatData.Ins.GLevelItem.Scene != "Meteor_21") { if (name.StartsWith("D_Item") || name.StartsWith("D_RJug") || name.StartsWith("D_itRJug") || name.StartsWith("D_BBox") || name.StartsWith("D_BBBox") || name.StartsWith("D_Box")) { if (root != null) { CombineChildren combine = root.gameObject.AddComponent <CombineChildren>(); combine.generateTriangleStrips = false; } else { CombineChildren combine = gameObject.AddComponent <CombineChildren>(); combine.generateTriangleStrips = false; } } } FMCFile f = FMCLoader.Ins.Load(s); if (f != null) { player = GetComponent <FMCPlayer>(); if (player == null) { player = gameObject.AddComponent <FMCPlayer>(); } player.Init(s, f); } else { player = GetComponent <FMCPlayer>(); if (player != null) { Destroy(player); player = null; } } } }