Commit ddc71877 authored by Unicorn's avatar Unicorn

fix OSX || LINUX

parent f41b50ec
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
public static class Config public static class Config
{ {
public static uint ClientVersion = 0x1344; public static uint ClientVersion = 0x1348;
class oneString class oneString
{ {
......
...@@ -21,7 +21,7 @@ public class Menu : WindowServantSP ...@@ -21,7 +21,7 @@ public class Menu : WindowServantSP
UIHelper.registEvent(gameObject, "single_", onClickPizzle); UIHelper.registEvent(gameObject, "single_", onClickPizzle);
//UIHelper.registEvent(gameObject, "ai_", onClickAI); //UIHelper.registEvent(gameObject, "ai_", onClickAI);
UIHelper.registEvent(gameObject, "exit_", onClickExit); UIHelper.registEvent(gameObject, "exit_", onClickExit);
(new Thread(up)).Start(); //(new Thread(up)).Start();
} }
public override void show() public override void show()
......
...@@ -829,7 +829,8 @@ public class Program : MonoBehaviour ...@@ -829,7 +829,8 @@ public class Program : MonoBehaviour
{ {
Screen.SetResolution(1300, 700, false); Screen.SetResolution(1300, 700, false);
} }
Application.targetFrameRate = 120; QualitySettings.vSyncCount = 0;
Application.targetFrameRate = 144;
mouseParticle = Instantiate(new_mouse); mouseParticle = Instantiate(new_mouse);
instance = this; instance = this;
initialize(); initialize();
......
...@@ -271,6 +271,7 @@ public class GameTextureManager ...@@ -271,6 +271,7 @@ public class GameTextureManager
if (File.Exists("picture/closeup/" + pic.code.ToString() + ".png")) if (File.Exists("picture/closeup/" + pic.code.ToString() + ".png"))
{ {
string path = "picture/closeup/" + pic.code.ToString() + ".png"; string path = "picture/closeup/" + pic.code.ToString() + ".png";
#if UNITY_EDITOR || UNITY_STANDALONE_WIN //编译器、Windows
BitmapHelper bitmap = new BitmapHelper(path); BitmapHelper bitmap = new BitmapHelper(path);
int left; int left;
int right; int right;
...@@ -301,6 +302,21 @@ public class GameTextureManager ...@@ -301,6 +302,21 @@ public class GameTextureManager
} }
caculateK(pic); caculateK(pic);
/*
* 以上处理其他平台无法正常使用
* 暂时只能直接贴图,以后再处理
*/
#elif UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX //Mac OS X、Linux
byte[] data;
using (FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read))
{
file.Seek(0, SeekOrigin.Begin);
data = new byte[file.Length];
file.Read(data, 0, (int)file.Length);
}
pic.data = data;
#endif
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type))) if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
{ {
loadedList.Add(hashPic(pic.code, pic.type), pic); loadedList.Add(hashPic(pic.code, pic.type), pic);
...@@ -573,6 +589,7 @@ public class GameTextureManager ...@@ -573,6 +589,7 @@ public class GameTextureManager
string path = "picture/closeup/" + pic.code.ToString() + ".png"; string path = "picture/closeup/" + pic.code.ToString() + ".png";
if (!File.Exists(path)) if (!File.Exists(path))
{ {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN //编译器、Windows
path = "picture/card/" + pic.code.ToString() + ".png"; path = "picture/card/" + pic.code.ToString() + ".png";
if (!File.Exists(path)) if (!File.Exists(path))
{ {
...@@ -600,9 +617,27 @@ public class GameTextureManager ...@@ -600,9 +617,27 @@ public class GameTextureManager
softVtype(pic, 0.5f); softVtype(pic, 0.5f);
pic.k = 1; pic.k = 1;
//pic.autoMade = true; //pic.autoMade = true;
/*
* 以上处理其他平台无法正常使用
* 暂时只能直接贴图,以后再处理
*/
#elif UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX //Mac OS X、Linux
path = "picture/null.png";
byte[] data;
using (FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read))
{
file.Seek(0, SeekOrigin.Begin);
data = new byte[file.Length];
file.Read(data, 0, (int)file.Length);
}
pic.data = data;
#endif
} }
else else
{ {
#if UNITY_EDITOR || UNITY_STANDALONE_WIN //编译器、Windows
BitmapHelper bitmap = new BitmapHelper(path); BitmapHelper bitmap = new BitmapHelper(path);
int left; int left;
int right; int right;
...@@ -654,6 +689,21 @@ public class GameTextureManager ...@@ -654,6 +689,21 @@ public class GameTextureManager
softVtype(pic,0.7f); softVtype(pic,0.7f);
} }
caculateK(pic); caculateK(pic);
/*
* 以上处理其他平台无法正常使用
* 暂时只能直接贴图,以后再处理
*/
#elif UNITY_STANDALONE_OSX || UNITY_STANDALONE_LINUX //Mac OS X、Linux
byte[] data;
using (FileStream file = new FileStream(path, FileMode.Open, FileAccess.Read))
{
file.Seek(0, SeekOrigin.Begin);
data = new byte[file.Length];
file.Read(data, 0, (int)file.Length);
}
pic.data = data;
#endif
} }
if (!loadedList.ContainsKey(hashPic(pic.code, pic.type))) if (!loadedList.ContainsKey(hashPic(pic.code, pic.type)))
......
...@@ -144,8 +144,8 @@ public class SelectServer : WindowServantSP ...@@ -144,8 +144,8 @@ public class SelectServer : WindowServantSP
string versionString = UIHelper.getByName<UIInput>(gameObject, "version_").value; string versionString = UIHelper.getByName<UIInput>(gameObject, "version_").value;
if (versionString=="") if (versionString=="")
{ {
UIHelper.getByName<UIInput>(gameObject, "version_").value = "0x133d"; UIHelper.getByName<UIInput>(gameObject, "version_").value = "0x1348";
versionString = "0x133d"; versionString = "0x1348";
} }
KF_onlineGame(Name, ipString, portString, versionString, pswString); KF_onlineGame(Name, ipString, portString, versionString, pswString);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment