public OverlayEditor(string _path, Texture2D _diffuse, string _filename, EditorUmaMaterial _uMaterial) { path = _path; diffuse = _diffuse; filename = _filename; uMaterial = _uMaterial; }
public SlotEditor(SkinnedMeshRenderer _slotMesh, string _name, string _foldpath, EditorUmaMaterial _uMaterial) { slotMesh = _slotMesh; assetName = _name; foldpath = _foldpath; slotMaterial = _uMaterial.Load(); }
public OverlayDataAsset GetOverlay() { #region 创建 EditorUmaMaterial uMaterial = EditorUmaMaterialFactory.Creat(Name); IObjectBase texture_diffuse = new ObjectBase(texturePath); (new CharacterTexture(texturePath)).Handle(); Texture2D dif = texture_diffuse.Load <Texture2D>(); OverlayEditor oeditor = new OverlayEditor(Fold, dif, Name, uMaterial); OverlayDataAsset overlay = oeditor.CreatOverlay(); #endregion return(overlay); }
public BaseClothItemEditor(IFbxItem _go, ECharacterResType type) { resType = type; gameObject = _go.Load <GameObject>(); if (gameObject.name == CharacterConst.Female) { baseFold = string.Format("{0}/{1}/{2}/{3}", CharacterConst.prefabPath, resType.ToString(), CharacterConst.Female, CharacterConst.Base); } else if (gameObject.name == CharacterConst.Male) { baseFold = string.Format("{0}/{1}/{2}/{3}", CharacterConst.prefabPath, resType.ToString(), CharacterConst.Male, CharacterConst.Base); } uMaterial = new EditorUmaMaterial_Base(); }
public ClothSlotOverlay(IObjectBase obj, Texture2D _diff, string Fold, EditorUmaMaterial mat, ECharacterResType type) { GameObject go = obj.Load <GameObject>(); slotMesh = go.GetComponentInChildren <SkinnedMeshRenderer>(); if (slotMesh == null) { throw new Exception(obj.Name + " could't find SkinnedMeshRenderer!!!"); } diff = _diff; Material[] ms = slotMesh.sharedMaterials; for (int i = 0; i < ms.Length; i++) { sharedMaterials.Add(ms[i].name); } slotMesh = go.GetComponentInChildren <SkinnedMeshRenderer>(); //slotMesh.sharedMaterial = null; //slotMesh.sharedMaterials = new Material[0]; baseName = go.name; slotFold = Fold + "/" + UMAUtils.Slot; overlayFold = Fold + "/" + UMAUtils.Overlay; Mat = mat; string comTexturePath = null; if (baseName.StartsWith("01")) {// male comTexturePath = string.Format("{0}/{1}/{2}/{3}_{4}.png", CharacterConst.rootPath, type.ToString(), CharacterConst.Male, CharacterConst.Male, CharacterConst.Common); } else {// female comTexturePath = string.Format("{0}/{1}/{2}/{3}_{4}.png", CharacterConst.rootPath, type.ToString(), CharacterConst.Female, CharacterConst.Female, CharacterConst.Common); } IObjectBase comt = new ObjectBase(comTexturePath); comTexture = comt.Load <Texture2D>(); (new CharacterTexture(comTexturePath)).Handle(); wearpos = int.Parse(baseName.Substring(2, 2)); }
public void CreatPrefab() { EditorUmaMaterial uMaterial = EditorUmaMaterialFactory.Creat(obj.Name); Texture2D dif = texture_diffuse.Load <Texture2D>(); ClothSlotOverlay cso = new ClothSlotOverlay(obj, dif, Fold, uMaterial, restype); List <SlotOverlayItem> sos = cso.CreatData(); if (sos == null) { return; } Dictionary <string, object> dic = new Dictionary <string, object>(); dic["sos"] = sos; prefab.CreatPrefab(null, createPrefabFinish, dic); }