public OverlayDataAsset CreatOverlay() { if (string.IsNullOrEmpty(path) || string.IsNullOrEmpty(filename) || diffuse == null) { Debug.LogError("path or filename or texture is null !!!"); return(null); } OverlayDataAsset oda = OverlayDataAsset.CreateInstance <OverlayDataAsset>(); oda.overlayName = filename; oda.material = uMaterial.Load(); oda.textureList = new Texture2D[] { diffuse }; if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } string p = path + "/" + filename + "_" + UMAUtils.Overlay + ".asset"; IObjectBase objBase = new ObjectBase(p); objBase.CreatAsset(oda); objBase.Save(); return(oda); }
public SlotEditor(SkinnedMeshRenderer _slotMesh, string _name, string _foldpath, EditorUmaMaterial _uMaterial) { slotMesh = _slotMesh; assetName = _name; foldpath = _foldpath; slotMaterial = _uMaterial.Load(); }