Commit 065f88da authored by Unicorn369's avatar Unicorn369

Upgrade to Unity5.6.7f1

parent ff10f957
......@@ -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)
......@@ -287,7 +287,7 @@ public class Program : MonoBehaviour
Screen.sleepTimeout = SleepTimeout.NeverSleep;
if (!File.Exists(ANDROID_GAME_PATH + "updates/version1.0.txt"))
{
string filePath = Application.streamingAssetsPath + "/ygocore.zip";
string filePath = Application.streamingAssetsPath + "/ygopro2.zip";
var www = new WWW(filePath);
while (!www.isDone) { }
byte[] bytes = www.bytes;
......@@ -301,7 +301,7 @@ public class Program : MonoBehaviour
string GamePaths = Application.persistentDataPath + "/ygopro2/";
if (!File.Exists(GamePaths + "updates/version1.0.txt"))
{
string filePath = Application.streamingAssetsPath + "/ygocore.zip";
string filePath = Application.streamingAssetsPath + "/ygopro2.zip";
var www = new WWW(filePath);
while (!www.isDone) { }
byte[] bytes = www.bytes;
......@@ -995,6 +995,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
......@@ -1013,6 +1021,8 @@ public class Program : MonoBehaviour
instance = this;
initialize();
go(500, () => { gameStart(); });
LastUpdateShowTime = Time.realtimeSinceStartup;
}
int preWid = 0;
......@@ -1023,15 +1033,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();
......
......@@ -10,25 +10,34 @@ using UnityEngine;
public class HttpDldFile
{
private readonly System.Threading.Semaphore semaphore = new System.Threading.Semaphore(6, 6);
public bool Download(string url, string filename)
{
bool flag = false;
try
{
if(!Directory.Exists(Path.GetDirectoryName(filename))){
Directory.CreateDirectory(Path.GetDirectoryName(filename));
}
using (var client = new WebClient())
{
ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback;
//client.Headers.Add(HttpRequestHeader.Authorization, string.Concat("token ", RepoData.GetToken()));
client.Headers.Add(HttpRequestHeader.ContentType,"application/x-www-form-urlencoded; charset=UTF-8");
client.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Edge/15.15063");
client.DownloadFile(new Uri(url), filename+".tmp");
}
flag = true;
if(File.Exists(filename))
if (!Directory.Exists(Path.GetDirectoryName(filename)))
{
Directory.CreateDirectory(Path.GetDirectoryName(filename));
}
using (var client = new TimeoutWebClient())
{
ServicePointManager.ServerCertificateValidationCallback = MyRemoteCertificateValidationCallback;
if (Path.GetExtension(filename).Contains("png"))
{
client.Timeout = 6500;
}
if (Path.GetExtension(filename).Contains("jpg"))
{
client.Timeout = 3500;
}
semaphore.WaitOne();
client.DownloadFile(new Uri(url), filename + ".tmp");
}
flag = true;
if (File.Exists(filename))
{
File.Delete(filename);
}
......@@ -38,6 +47,10 @@ public class HttpDldFile
{
flag = false;
}
finally
{
semaphore.Release();
}
return flag;
}
public static bool MyRemoteCertificateValidationCallback(System.Object sender,
......@@ -68,5 +81,25 @@ public class HttpDldFile
}
return isOk;
}
}
public class TimeoutWebClient : WebClient
{
public int Timeout { get; set; }
public TimeoutWebClient()
{
Timeout = 10000;
}
public TimeoutWebClient(int timeout)
{
Timeout = timeout;
}
protected override WebRequest GetWebRequest(Uri address)
{
WebRequest request = base.GetWebRequest(address);
request.Timeout = Timeout;
return request;
}
}
\ No newline at end of file
using UnityEngine;
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Linq;
public class RoomList : WindowServantSP
......@@ -11,13 +8,13 @@ public class RoomList : WindowServantSP
List<string[]> listOfRooms = new List<string[]>();
bool hideAI;
bool hideStarted;
UILabel roomNameLabel;
UILabel roomPSWLabel;
public override void initialize()
{
createWindow(Program.I().new_ui_RoomList);
UIHelper.registEvent(gameObject, "exit_", onClickExit);
UIHelper.registEvent(gameObject, "refresh_", onRefresh);
roomNameLabel = UIHelper.getByName<UILabel>(gameObject, "roomNameLabel");
roomPSWLabel = UIHelper.getByName<UILabel>(gameObject, "roomNameLabel");
hideAI =UIHelper.getByName<UIToggle>(gameObject, "hideAIrooms_").value = UIHelper.fromStringToBool(Config.Get("hideAIrooms_", "1"));
hideStarted=UIHelper.getByName<UIToggle>(gameObject, "hideStarted_").value = UIHelper.fromStringToBool(Config.Get("hideStarted_", "1"));
UIHelper.registEvent(gameObject, "hideAIrooms_", save);
......@@ -54,7 +51,7 @@ public class RoomList : WindowServantSP
}
public override void hide()
{
roomNameLabel.text = "";
roomPSWLabel.text = "";
base.hide();
}
......@@ -77,17 +74,6 @@ public class RoomList : WindowServantSP
{
superScrollView.add(room[9]);
}
//for (int i = 0; i < listOfRooms.Count; i++)
//{
// //if (listOfRooms[i].Length > 4)
// //{
// // //if (/*listOfRooms[i].Substring(fileInfos[i].Name.Length - 4, 4) == ".lua"*/)
// // //{
// // // // superScrollView.add(listOfRooms[i].Substring(0, listOf.Name.Length - 4));
// // //}
// //}
//}
}
string selectedString = string.Empty;
......@@ -106,12 +92,14 @@ public class RoomList : WindowServantSP
}
selectedString = superScrollView.selectedString;
roomPsw= listOfRooms.Find(s => s[9] == selectedString)[2];
int roomNameIndex = roomPsw.LastIndexOf("#")+1;
if (roomNameIndex > 0)
if (roomPsw != null)
{
roomNameLabel.text = roomPsw.Substring(roomNameIndex);
roomPSWLabel.text = roomPsw;
}
else
{
roomPSWLabel.text = "";
}
}
void JoinRoom(string selectedString,string roomPsw)
......
......@@ -6,6 +6,8 @@ public class Setting : WindowServant2D
public LAZYsetting setting;
public bool batterySaving;
public override void initialize()
{
gameObject = createWindow(this, Program.I().new_ui_setting);
......@@ -14,6 +16,8 @@ public class Setting : WindowServant2D
UIHelper.registEvent(gameObject, "screen_", resizeScreen);
UIHelper.registEvent(gameObject, "full_", resizeScreen);
UIHelper.registEvent(gameObject, "resize_", resizeScreen);
UIHelper.registEvent(gameObject, "batterySaving", batterySavingMode);
batterySaving = UIHelper.getByName<UIToggle>(gameObject, "batterySaving").value = UIHelper.fromStringToBool(Config.Get("batterySaving", "0"));
UIHelper.getByName<UIToggle>(gameObject, "full_").value = Screen.fullScreen;
UIHelper.getByName<UIPopupList>(gameObject, "screen_").value = Screen.width.ToString() + "*" + Screen.height.ToString();
UIHelper.getByName<UIToggle>(gameObject, "ignoreWatcher_").value = UIHelper.fromStringToBool(Config.Get("ignoreWatcher_", "0"));
......@@ -77,6 +81,20 @@ public class Setting : WindowServant2D
onchangeCloud();
}
private void batterySavingMode()
{
if (batterySaving)
{
Application.targetFrameRate = 30;
}
else
{
Application.targetFrameRate = -1;
}
batterySaving = !batterySaving;
save();
}
private void readVales()
{
try
......@@ -237,6 +255,7 @@ public class Setting : WindowServant2D
public void save()
{
Config.Set("batterySaving", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "batterySaving").value));
Config.Set("ignoreWatcher_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "ignoreWatcher_").value));
Config.Set("ignoreOP_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "ignoreOP_").value));
Config.Set("smartSelect_", UIHelper.fromBoolToString(UIHelper.getByName<UIToggle>(gameObject, "smartSelect_").value));
......
fileFormatVersion: 2
guid: 7cc6adf5988b03345bc3fbbdb145cbab
timeCreated: 1548561685
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
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