using UnityEngine;
using UnityEditor;
using System;
using System.Collections.Generic;
using System.Collections;
namespace WeChatWASM
{
[Serializable]
public class WXProjectConf
{
///
/// 小游戏项目名
///
public string projectName;
///
/// 游戏appid
///
public string Appid;
///
/// 游戏资源CDN
///
public string CDN;
///
/// 首包资源加载方式
///
public int assetLoadType;
///
/// 视频url
///
public string VideoUrl;
///
/// 导出路径(绝对路径)
///
public string DST = "";
///
/// AB包CDN地址
///
public string StreamCDN = "";
///
/// bundle的hash长度
///
public int bundleHashLength = 32;
///
/// 路径中包含什么标识符表示下载bundle,需要自动缓存
///
public string bundlePathIdentifier = "StreamingAssets;";
///
/// 排除路径下指定类型文件不缓存
///
public string bundleExcludeExtensions = "json;";
///
/// Assets目录对应CDN地址
///
public string AssetsUrl = "";
///
/// 游戏内存大小(MB)
///
public int MemorySize = 256;
///
/// callmain完成后是否立即隐藏加载封面
///
public bool HideAfterCallMain = true;
///
/// 预下载列表
///
public string preloadFiles = "";
///
/// 游戏方向
///
public WXScreenOritation Orientation = WXScreenOritation.Portrait;
///
/// 启动视频封面图/背景图
///
public string bgImageSrc = "Assets/WX-WASM-SDK/wechat-default/images/background.jpg";
///
/// 拼接在DATA_CDN和首包资源文件名的路径,用于首包资源没放到DATA_CDN根目录的情况
///
public string dataFileSubPrefix = "";
///
/// 最大缓存容量,单位MB
///
public int maxStorage = 200;
///
/// 清理缓存时默认额外清理的大小,单位Bytes,默认值30MB
///
public int defaultReleaseSize = 31457280;
///
/// 纹理中hash长度
///
public int texturesHashLength = 8;
///
/// 纹理存储路径
///
public string texturesPath = "Assets/Textures";
///
/// 是否缓存纹理
///
public bool needCacheTextures = true;
///
/// 加载进度条的宽度,默认240
///
public int loadingBarWidth = 240;
///
/// 是否需要启动时自动检查小游戏是否有新版本
///
public bool needCheckUpdate = false;
}
[Serializable]
public class CompressTexture
{
///
/// 自动将图片尺寸减小一半
///
public bool halfSize = false;
///
/// 使用pc端压缩纹理
///
public bool useDXT5 = false;
///
/// bundle文件后缀
///
public string bundleSuffix = "bundle";
///
/// 是否加载bundle时同时加载对应纹理
///
public bool parallelWithBundle = false;
///
/// 自定义bundle路径
///
public string bundleDir;
///
/// 自定义生成目录路径
///
public string dstMinDir;
}
[Serializable]
public class SDKOptions
{
///
/// 使用微信音频API
///
public bool UseAudioApi = false;
///
/// 使用好友关系链
///
public bool UseFriendRelation = false;
///
/// 使用压缩纹理替换(beta)
///
public bool UseCompressedTexture = false;
}
[Serializable]
public class CompileOptions
{
///
/// Development Build
///
public bool DevelopBuild = false;
///
/// Autoconnect Profiler
///
public bool AutoProfile = false;
///
/// Scripts Only Build
///
public bool ScriptOnly = false;
///
/// Profiling Funcs
///
public bool profilingFuncs = false;
///
/// WebGL2.0
///
public bool Webgl2 = false;
///
/// DeleteStreamingAssets
///
public bool DeleteStreamingAssets = true;
///
/// ProfilingMemory
///
public bool ProfilingMemory = false;
}
public enum WXScreenOritation
{
Portrait, Landscape, LandscapeLeft, LandscapeRight
};
public class WXEditorScriptObject : ScriptableObject
{
public WXProjectConf ProjectConf;
public SDKOptions SDKOptions;
public CompileOptions CompileOptions;
///
/// 压缩纹理配置
///
public CompressTexture CompressTexture;
///
/// 小游戏里会预先加载的key
///
public List PlayerPrefsKeys = new List();
}
}