浏览代码

android fix

/siyaoH-1.17-PlatformMessage
siyao 4 年前
当前提交
5d3c7b3a
共有 2 个文件被更改,包括 19 次插入0 次删除
  1. 11
      com.unity.uiwidgets/Runtime/painting/image_provider.cs
  2. 8
      com.unity.uiwidgets/Runtime/ui2/text.cs

11
com.unity.uiwidgets/Runtime/painting/image_provider.cs


}
Future<Codec> _loadAsync(FileImage key, DecoderCallback decode) {
#if UNITY_ANDROID && !UNITY_EDITOR
var path = Path.Combine(Application.streamingAssetsPath, key.file);
Debug.Log("path: "+path);
WWW unpackerWWW = new WWW(Path.Combine(Application.streamingAssetsPath, key.file));
while (!unpackerWWW.isDone) {
} // This will block in the webplayer.
Debug.Log("load complete: "+unpackerWWW.bytes.Length);
byte[] bytes = unpackerWWW.bytes;
#else
#endif
if (bytes.Length > 0) {
return decode(bytes);
}

8
com.unity.uiwidgets/Runtime/ui2/text.cs


internal static unsafe void setFloat(this byte[] bytes, int byteOffset, float value) {
D.assert(byteOffset >= 0 && byteOffset + 4 < bytes.Length);
fixed (byte* b = &bytes[byteOffset]) {
#if UNITY_ANDROID && !UNITY_EDITOR
byte[] vOut = BitConverter.GetBytes(value);
b[0] = vOut[0];
b[1] = vOut[1];
b[2] = vOut[2];
b[3] = vOut[3];
#else
#endif
}
}

正在加载...
取消
保存