Commit 664226a3 authored by Unicorn369's avatar Unicorn369

Upgrade to Unity5.6.7f1

parent a8515cc4
......@@ -6,22 +6,17 @@ ifndef config
endif
export config
PROJECTS := sqlite3 ocgcore
PROJECTS := ocgcore
.PHONY: all clean help $(PROJECTS)
all: $(PROJECTS)
sqlite3:
@echo "==== Building sqlite3 ($(config)) ===="
@${MAKE} --no-print-directory -C . -f sqlite3.make
ocgcore:
@echo "==== Building ocgcore ($(config)) ===="
@${MAKE} --no-print-directory -C . -f ocgcore.make
clean:
@${MAKE} --no-print-directory -C . -f sqlite3.make clean
@${MAKE} --no-print-directory -C . -f ocgcore.make clean
help:
......@@ -34,7 +29,6 @@ help:
@echo "TARGETS:"
@echo " all (default)"
@echo " clean"
@echo " sqlite3"
@echo " ocgcore"
@echo ""
@echo "For more information, see http://industriousone.com/premake/quick-start"
# GNU Make project makefile autogenerated by Premake
ifndef config
config=release
endif
ifndef verbose
SILENT = @
endif
ifndef CC
CC = gcc
endif
ifndef CXX
CXX = g++
endif
ifndef AR
AR = ar
endif
ifeq ($(config),release)
OBJDIR = ../../obj/Linux/x86_64/sqlite3
TARGETDIR = ../../bin/x86_64
TARGET = $(TARGETDIR)/libsqlite3.so
DEFINES += -DLUA_USE_LINUX
INCLUDES +=
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) $(ARCH) -Os -fPIC -fno-strict-aliasing -Wno-multichar
CXXFLAGS += $(CFLAGS)
LDFLAGS += -s -shared
LIBS +=
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
ifeq ($(config),release32)
OBJDIR = ../../obj/Linux/x86/sqlite3
TARGETDIR = ../../bin/x86
TARGET = $(TARGETDIR)/libsqlite3.so
DEFINES += -DLUA_USE_LINUX
INCLUDES +=
CPPFLAGS += -MMD -MP $(DEFINES) $(INCLUDES)
CFLAGS += $(CPPFLAGS) $(ARCH) -Os -m32 -fPIC -fno-strict-aliasing -Wno-multichar
CXXFLAGS += $(CFLAGS)
LDFLAGS += -s -shared -m32 -L/usr/lib32
LIBS +=
RESFLAGS += $(DEFINES) $(INCLUDES)
LDDEPS +=
LINKCMD = $(CXX) -o $(TARGET) $(OBJECTS) $(LDFLAGS) $(RESOURCES) $(ARCH) $(LIBS)
define PREBUILDCMDS
endef
define PRELINKCMDS
endef
define POSTBUILDCMDS
endef
endif
OBJECTS := \
$(OBJDIR)/sqlite3.o \
RESOURCES := \
SHELLTYPE := msdos
ifeq (,$(ComSpec)$(COMSPEC))
SHELLTYPE := posix
endif
ifeq (/bin,$(findstring /bin,$(SHELL)))
SHELLTYPE := posix
endif
.PHONY: clean prebuild prelink
all: $(TARGETDIR) $(OBJDIR) prebuild prelink $(TARGET)
@:
$(TARGET): $(GCH) $(OBJECTS) $(LDDEPS) $(RESOURCES)
@echo Linking sqlite3
$(SILENT) $(LINKCMD)
$(POSTBUILDCMDS)
$(TARGETDIR):
@echo Creating $(TARGETDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(TARGETDIR)
else
$(SILENT) mkdir $(subst /,\\,$(TARGETDIR))
endif
$(OBJDIR):
@echo Creating $(OBJDIR)
ifeq (posix,$(SHELLTYPE))
$(SILENT) mkdir -p $(OBJDIR)
else
$(SILENT) mkdir $(subst /,\\,$(OBJDIR))
endif
clean:
@echo Cleaning sqlite3
ifeq (posix,$(SHELLTYPE))
$(SILENT) rm -f $(TARGET)
$(SILENT) rm -rf $(OBJDIR)
else
$(SILENT) if exist $(subst /,\\,$(TARGET)) del $(subst /,\\,$(TARGET))
$(SILENT) if exist $(subst /,\\,$(OBJDIR)) rmdir /s /q $(subst /,\\,$(OBJDIR))
endif
prebuild:
$(PREBUILDCMDS)
prelink:
$(PRELINKCMDS)
ifneq (,$(PCH))
$(GCH): $(PCH)
@echo $(notdir $<)
-$(SILENT) cp $< $(OBJDIR)
$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"
endif
$(OBJDIR)/sqlite3.o: ../../ocgcore/sqlite3.c
@echo $(notdir $<)
$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"
-include $(OBJECTS:%.o=%.d)
using UnityEngine;
using System.IO;
public class AppLanguage
{
public static string CN = "/zh-CN"; //简体中文(中国) ChineseSimplified
public static string TW = "/zh-TW"; //繁体中文(台湾) ChineseTraditional
public static string Chinese = "/Chinese"; //汉语
public static string US = "/en-US"; //英语(美国) English
public static string FR = "/fr-FR"; //法语(法国) French
public static string DE = "/de-DE"; //德语(德国) German
public static string IT = "/it-IT"; //意大利语(意大利) Italian
public static string JP = "/ja-JP"; //日语(日本) Japanese
public static string KR = "/ko-KR"; //韩语(韩国) Korean
public static string ES = "/es-ES"; //西班牙语(西班牙) Spanish
public static string Null = ""; //Unknown
//public static string Null = "en-WW"; //English
/*public static string LanguageDir()
{
if (Application.systemLanguage == SystemLanguage.ChineseSimplified) { //可能无法识别
return CN; //中文简体
} else if (Application.systemLanguage == SystemLanguage.ChineseTraditional) {//可能无法识别
return TW; //中文繁體
} else if (Application.systemLanguage == SystemLanguage.Chinese) {
return CN; //中文
} else if (Application.systemLanguage == SystemLanguage.English) {
return US; //English
} else if (Application.systemLanguage == SystemLanguage.French) {
return FR; //Français
} else if (Application.systemLanguage == SystemLanguage.German) {
return DE; //Deutsch
} else if (Application.systemLanguage == SystemLanguage.Italian) {
return IT; //Italiano
} else if (Application.systemLanguage == SystemLanguage.Japanese) {
return JP; //日本語
} else if (Application.systemLanguage == SystemLanguage.Korean) {
return KR; //한국어
} else if (Application.systemLanguage == SystemLanguage.Spanish) {
return ES; //Español
} else {
return Null;
}
}*/
public static string LanguageDir()
{
if (Application.systemLanguage == SystemLanguage.ChineseSimplified) { //可能无法识别
if (Directory.Exists("cdb/zh-CN") && Directory.Exists("config/zh-CN")) {
return CN; //中文简体
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.ChineseTraditional) {//可能无法识别
if (Directory.Exists("cdb/zh-TW") && Directory.Exists("config/zh-TW")) {
return TW; //中文繁體
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.Chinese) {
if (Directory.Exists("cdb/Chinese") && Directory.Exists("config/Chinese")) {
return Chinese; //汉语
} else if (Directory.Exists("cdb/zh-CN") && Directory.Exists("config/zh-CN")) {
return CN; //中文简体
} else if (Directory.Exists("cdb/zh-TW") && Directory.Exists("config/zh-TW")) {
return TW; //中文繁體
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.English) {
if (Directory.Exists("cdb/en-US") && Directory.Exists("config/en-US")) {
return US; //English
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.French) {
if (Directory.Exists("cdb/fr-FR") && Directory.Exists("config/fr-FR")) {
return FR; //Français
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.German) {
if (Directory.Exists("cdb/de-DE") && Directory.Exists("config/de-DE")) {
return DE; //Deutsch
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.Italian) {
if (Directory.Exists("cdb/it-IT") && Directory.Exists("config/it-IT")) {
return IT; //Italiano
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.Japanese) {
if (Directory.Exists("cdb/ja-JP") && Directory.Exists("config/ja-JP")) {
return JP; //日本語
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.Korean) {
if (Directory.Exists("cdb/ko-KR") && Directory.Exists("config/ko-KR")) {
return KR; //한국어
} else {
return Null;
}
} else if (Application.systemLanguage == SystemLanguage.Spanish) {
if (Directory.Exists("cdb/es-ES") && Directory.Exists("config/es-ES")) {
return ES; //Español
} else {
return Null;
}
} else {
return Null;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 4778973ded4d5c445b9ca998391a2c29
timeCreated: 1538811664
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -274,7 +274,7 @@ public class Program : MonoBehaviour
public static float verticleScale = 5f;
//YGOPro2 Path (https://github.com/Unicorn369/YGOPro2_Droid/tree/Test)
//YGOPro2 Path (https://github.com/Unicorn369/YGOPro2_Droid/tree/Test) //Multi-language support
public static string ANDROID_GAME_PATH = "/storage/emulated/0/ygocore/";//YGOMobile Path
void initialize()
......@@ -285,7 +285,7 @@ public class Program : MonoBehaviour
#elif UNITY_ANDROID //Android
Screen.sleepTimeout = SleepTimeout.NeverSleep;
if (!File.Exists(ANDROID_GAME_PATH + "updates/version1.0.txt"))
if (!File.Exists(ANDROID_GAME_PATH + "updates/version1.1.txt"))
{
string filePath = Application.streamingAssetsPath + "/ygocore.zip";
var www = new WWW(filePath);
......@@ -299,7 +299,7 @@ public class Program : MonoBehaviour
#elif UNITY_IPHONE //iPhone
string GamePaths = Application.persistentDataPath + "/ygopro2/";
if (!File.Exists(GamePaths + "updates/version1.0.txt"))
if (!File.Exists(GamePaths + "updates/version1.1.txt"))
{
string filePath = Application.streamingAssetsPath + "/ygocore.zip";
var www = new WWW(filePath);
......@@ -323,7 +323,6 @@ public class Program : MonoBehaviour
{
//UpdateClient();
InterString.initialize("config/translation.conf");
//InterString.initialize("config" + AppLanguage.LanguageDir() + "/translation.conf"); //System Language
GameTextureManager.initialize();
Config.initialize("config/config.conf");
GameStringManager.initialize("strings.conf");//YGOMobile Paths
......@@ -338,25 +337,9 @@ public class Program : MonoBehaviour
YGOSharp.BanlistManager.initialize("lflist.conf");//YGOMobile Paths
YGOSharp.CardsManager.initialize("cards.cdb");//YGOMobile Paths
/*FileInfo[] fileInfos = (new DirectoryInfo("cdb")).GetFiles().OrderByDescending(x => x.Name).ToArray();
//FileInfo[] fileInfos = (new DirectoryInfo("cdb" + AppLanguage.LanguageDir())).GetFiles().OrderByDescending(x => x.Name).ToArray();//System Language
for (int i = 0; i < fileInfos.Length; i++)
{
if (fileInfos[i].Name.Length > 4)
{
if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".cdb")
{
YGOSharp.CardsManager.initialize("cdb/" + fileInfos[i].Name);
//YGOSharp.CardsManager.initialize("cdb" + AppLanguage.LanguageDir() + "/" + fileInfos[i].Name);//System Language
}
}
}*/
if (Directory.Exists("expansions"))
//if (Directory.Exists("expansions" + AppLanguage.LanguageDir()))//System Language
{
FileInfo[] fileInfos = (new DirectoryInfo("expansions")).GetFiles().OrderByDescending(x => x.Name).ToArray();
//fileInfos = (new DirectoryInfo("expansions" + AppLanguage.LanguageDir())).GetFiles().OrderByDescending(x => x.Name).ToArray();//System Language
for (int i = 0; i < fileInfos.Length; i++)
{
if (fileInfos[i].Name.Length > 4)
......@@ -364,17 +347,14 @@ public class Program : MonoBehaviour
if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 4, 4) == ".cdb")
{
YGOSharp.CardsManager.initialize("expansions/" + fileInfos[i].Name);
//YGOSharp.CardsManager.initialize("expansions" + AppLanguage.LanguageDir() + "/" + fileInfos[i].Name);
}
}
}
}
if (Directory.Exists("pack"))
{
FileInfo[] fileInfos = (new DirectoryInfo("pack")).GetFiles();
//fileInfos = (new DirectoryInfo("pack" + AppLanguage.LanguageDir())).GetFiles();
for (int i = 0; i < fileInfos.Length; i++)
{
if (fileInfos[i].Name.Length > 3)
......@@ -382,7 +362,6 @@ public class Program : MonoBehaviour
if (fileInfos[i].Name.Substring(fileInfos[i].Name.Length - 3, 3) == ".db")
{
YGOSharp.PacksManager.initialize("pack/" + fileInfos[i].Name);
//YGOSharp.PacksManager.initialize("pack" + AppLanguage.LanguageDir() + "/" + fileInfos[i].Name);
}
}
}
......@@ -393,12 +372,11 @@ public class Program : MonoBehaviour
#if UNITY_ANDROID //Android Java Test
AndroidJavaObject jo = new AndroidJavaObject("cn.unicorn369.library.API");
if (!File.Exists("updates/image_version1.0.txt"))//用于检查更新
if (!File.Exists("updates/image_version1.1.txt"))//用于检查更新
{
if (File.Exists("pics.zip"))//YGOMobile内置的卡图包
{
if (File.Exists("pics.zip")) {//YGOMobile内置的卡图包
jo.Call("doExtractZipFile", "pics.zip", ANDROID_GAME_PATH);
File.Create("updates/image_version1.0.txt");
File.Create("updates/image_version1.1.txt");
} else {
jo.Call("showToast", "没有发现卡图包,是否未安装YGOMobile");
}
......@@ -1004,6 +982,14 @@ public class Program : MonoBehaviour
#region MonoBehaviors
private float LastUpdateShowTime = 0f;
private float UpdateShowDeltaTime = 1f; //更新帧率
private int FrameUpdate = 0;
private float m_FPS = 0;
void Start()
{
#if UNITY_EDITOR || UNITY_STANDALONE_WIN //编译器、Windows
......@@ -1022,6 +1008,8 @@ public class Program : MonoBehaviour
instance = this;
initialize();
go(500, () => { gameStart(); });
LastUpdateShowTime = Time.realtimeSinceStartup;
}
int preWid = 0;
......@@ -1032,15 +1020,26 @@ public class Program : MonoBehaviour
void OnGUI()
{
if (Event.current.type == EventType.ScrollWheel)
if (Event.current.type == EventType.ScrollWheel) {
_padScroll = -Event.current.delta.y / 100;
else
} else {
_padScroll = 0;
}
//GUI.Label(new Rect(Screen.width / 2, 0, 100, 100), "FPS: " + m_FPS);
GUI.Label(new Rect(10, 5, 100, 100), "FPS: " + m_FPS);
}
void Update()
{
FrameUpdate++;
if(Time.realtimeSinceStartup - LastUpdateShowTime >= UpdateShowDeltaTime)
{
m_FPS = FrameUpdate / (Time.realtimeSinceStartup - LastUpdateShowTime);
FrameUpdate = 0;
LastUpdateShowTime = Time.realtimeSinceStartup;
}
if (preWid != Screen.width || preheight != Screen.height)
{
Resources.UnloadUnusedAssets();
......
......@@ -811,13 +811,13 @@ public class GameTextureManager
if (!File.Exists(path) && pic.code != 0 && Program.DownloadImage)
{
//YGOMobile (177x254)
df.Download("http://download.ygopro.win/ygopro/pics/" + pic.code.ToString() + ".jpg", "expansions/pics/" + pic.code.ToString() + ".jpg");
df.Download("http://download.ygo2019.xyz/ygopro/pics/" + pic.code.ToString() + ".jpg", "expansions/pics/" + pic.code.ToString() + ".jpg");
path = "expansions/pics/" + pic.code.ToString() + ".jpg";
}
if (!File.Exists(path) && pic.code != 0 && Program.DownloadImage)
{
//先行卡 (177x254)
df.Download("http://download.ygopro.win/ygopro2-data/expansions/pics/" + pic.code.ToString() + ".jpg", "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg");
df.Download("http://download.ygo2019.xyz/ygopro2-data/expansions/pics/" + pic.code.ToString() + ".jpg", "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg");
path = "picture/cardIn8thEdition/" + pic.code.ToString() + ".jpg";
}
if (!File.Exists(path))
......
fileFormatVersion: 2
guid: 7cc6adf5988b03345bc3fbbdb145cbab
timeCreated: 1548561685
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
guid: 7222ecfae3a1484299c43f7272174c56
fileFormatVersion: 2
guid: 7222ecfae3a1484299c43f7272174c56
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 1
settings:
DefaultValueInitialized: true
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
......@@ -148,7 +148,7 @@ PlayerSettings:
tvOS: cn.ygopro2.ygopro2android
buildNumber:
iOS:
AndroidBundleVersionCode: 1
AndroidBundleVersionCode: 2
AndroidMinSdkVersion: 16
AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 0
......
m_EditorVersion: 5.6.6f2
m_EditorVersion: 5.6.7f1
......@@ -54,9 +54,9 @@ The feedbacks is checked every day.
> `cp -f -r libs ../../../Assets/Plugins/Android/`
# How to compile the libocgcore.so、libsqlite3.so? (Linux)
# How to compile the libocgcore.so? (Linux)
*In most case you do not need to care about the libocgcore.so、libsqlite3.so.*
*In most case you do not need to care about the libocgcore.so.*
> `cd AI_core_vs2017solution/build/gmake.linux`
......
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