Commit ddc71877 authored by Unicorn's avatar Unicorn

fix OSX || LINUX

parent f41b50ec
......@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.IO;
public static class Config
{
public static uint ClientVersion = 0x1344;
public static uint ClientVersion = 0x1348;
class oneString
{
......
......@@ -21,7 +21,7 @@ public class Menu : WindowServantSP
UIHelper.registEvent(gameObject, "single_", onClickPizzle);
//UIHelper.registEvent(gameObject, "ai_", onClickAI);
UIHelper.registEvent(gameObject, "exit_", onClickExit);
(new Thread(up)).Start();
//(new Thread(up)).Start();
}
public override void show()
......
......@@ -829,7 +829,8 @@ public class Program : MonoBehaviour
{
Screen.SetResolution(1300, 700, false);
}
Application.targetFrameRate = 120;
QualitySettings.vSyncCount = 0;
Application.targetFrameRate = 144;
mouseParticle = Instantiate(new_mouse);
instance = this;
initialize();
......
......@@ -119,29 +119,29 @@ public class GameStringHelper
public static string getName(YGOSharp.Card card)
{
string limitot = "";
switch(card.Ot)
{
case 1:
limitot = "[OCG] ";
break;
case 2:
limitot = "[TCG] ";
break;
case 3:
limitot = "[OCG/TCG] ";
break;
case 4:
limitot = "[Anime] ";
break;
}
string limitot = "";
switch(card.Ot)
{
case 1:
limitot = "[OCG] ";
break;
case 2:
limitot = "[TCG] ";
break;
case 3:
limitot = "[OCG/TCG] ";
break;
case 4:
limitot = "[Anime] ";
break;
}
string re = "";
try
{
re += "[b]" + card.Name + "[/b]";
re += "\n";
re += "[sup]" + limitot + "[/sup]";
re += "\r";
re += "[sup]" + limitot + "[/sup]";
re += "\r";
re += "[sup]" + card.Id.ToString() + "[/sup]";
re += "\n";
}
......
......@@ -271,6 +271,7 @@ public class GameTextureManager
if (File.Exists("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);
int left;
int right;
......@@ -301,6 +302,21 @@ public class GameTextureManager
}
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)))
{
loadedList.Add(hashPic(pic.code, pic.type), pic);
......@@ -573,6 +589,7 @@ public class GameTextureManager
string path = "picture/closeup/" + pic.code.ToString() + ".png";
if (!File.Exists(path))
{
#if UNITY_EDITOR || UNITY_STANDALONE_WIN //编译器、Windows
path = "picture/card/" + pic.code.ToString() + ".png";
if (!File.Exists(path))
{
......@@ -600,9 +617,27 @@ public class GameTextureManager
softVtype(pic, 0.5f);
pic.k = 1;
//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
{
#if UNITY_EDITOR || UNITY_STANDALONE_WIN //编译器、Windows
BitmapHelper bitmap = new BitmapHelper(path);
int left;
int right;
......@@ -654,6 +689,21 @@ public class GameTextureManager
softVtype(pic,0.7f);
}
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)))
......@@ -694,7 +744,7 @@ public class GameTextureManager
if (a > alpha)
a = alpha;
}
if (w < empWidth)
if (a > ((float)w) / (float)empWidth)
a = ((float)w) / (float)empWidth;
......
......@@ -144,8 +144,8 @@ public class SelectServer : WindowServantSP
string versionString = UIHelper.getByName<UIInput>(gameObject, "version_").value;
if (versionString=="")
{
UIHelper.getByName<UIInput>(gameObject, "version_").value = "0x133d";
versionString = "0x133d";
UIHelper.getByName<UIInput>(gameObject, "version_").value = "0x1348";
versionString = "0x1348";
}
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