public void Run(string assetName, string assetType, string originalFileName, RestCreateAssetCallback inCallback) { asset = new Spaces.Core.Asset(); asset.name = assetName; asset.assetType = assetType; asset.originalFileName = originalFileName; //createdWithRef = false; var args = new CreateAssetData() { asset_type = asset.assetType, name = asset.name, orig_file_name = asset.originalFileName }; RestManager.Post(this, RestManager.Request.CREATE_ASSET, TinyJSON.Encoder.Encode(args, TinyJSON.EncodeOptions.NoTypeHints), CreateAssetReply); doneCallback = inCallback; }
public static Asset CreateAsset(string assetName, string assetType, string sourcePath, RestCreateAssetCallback callback) { var createdAsset = new Asset(); createdAsset.SetDataSourcePath(sourcePath); string fileName = System.IO.Path.GetFileName(sourcePath); if (string.IsNullOrEmpty(System.IO.Path.GetExtension(sourcePath)) && assetType == Core.Constants.AssetType.assetbundle.ToString()) { fileName += ".unity3d"; } var createAsset = new RestCreateAsset(); createAsset.Run(ref createdAsset, assetName, assetType, fileName, callback); return(createdAsset); }
public static Asset CreateAsset(string assetName, string assetType, RestCreateAssetCallback callback) { return(CreateAsset(assetName, assetType, "", callback)); }