Commit dd3ad4b5 authored by SherryChaos's avatar SherryChaos

new multi platform struct

parent 0816fc25
File deleted
...@@ -18,6 +18,8 @@ ExportedObj/ ...@@ -18,6 +18,8 @@ ExportedObj/
*.svd *.svd
*.pdb *.pdb
/.utmp/ /.utmp/
.DS_Store
.vscode/
# Unity3D generated files # Unity3D generated files
[Ll]ibrary/ [Ll]ibrary/
...@@ -36,7 +38,6 @@ sysinfo.txt ...@@ -36,7 +38,6 @@ sysinfo.txt
*.gradle *.gradle
# MDPro3 Assets # MDPro3 Assets
/Android/
/AssetsUnused/ /AssetsUnused/
/[Dd]eck/ /[Dd]eck/
/[Ee]xpansions/ /[Ee]xpansions/
...@@ -45,7 +46,7 @@ sysinfo.txt ...@@ -45,7 +46,7 @@ sysinfo.txt
/[Pp]uzzle/ /[Pp]uzzle/
/[Rr]eplay/ /[Rr]eplay/
/[Ss]ound/ /[Ss]ound/
/StandaloneWindows64/ /Platforms/
/TempFolder/ /TempFolder/
Tools/YGO Classes/build/windows/build/ Tools/YGO Classes/build/windows/build/
Tools/YGO Classes/build/android/libs/ Tools/YGO Classes/build/android/libs/
......
...@@ -61,7 +61,7 @@ namespace MDPro3 ...@@ -61,7 +61,7 @@ namespace MDPro3
ret.len = 0; ret.len = 0;
var fileName2 = fileName.TrimStart('.', '/'); var fileName2 = fileName.TrimStart('.', '/');
if (fileName.StartsWith(Program.puzzlePath) || fileName.StartsWith(Program.tempFolder)) if (fileName.StartsWith(Program.puzzlePath) || fileName.StartsWith(Program.PATH_TEMP_FOLDER))
{ {
if (File.Exists(fileName)) if (File.Exists(fileName))
{ {
......
...@@ -32,10 +32,10 @@ namespace MDPro3.Duel.YGOSharp ...@@ -32,10 +32,10 @@ namespace MDPro3.Duel.YGOSharp
if (file.ToLower().EndsWith("lflist.conf")) if (file.ToLower().EndsWith("lflist.conf"))
{ {
var e = zip[file]; var e = zip[file];
if (!Directory.Exists(Program.tempFolder)) if (!Directory.Exists(Program.PATH_TEMP_FOLDER))
Directory.CreateDirectory(Program.tempFolder); Directory.CreateDirectory(Program.PATH_TEMP_FOLDER);
var tempFile = Path.Combine(Path.GetFullPath(Program.tempFolder), file); var tempFile = Path.Combine(Path.GetFullPath(Program.PATH_TEMP_FOLDER), file);
e.Extract(Path.GetFullPath(Program.tempFolder), ExtractExistingFileAction.OverwriteSilently); e.Extract(Path.GetFullPath(Program.PATH_TEMP_FOLDER), ExtractExistingFileAction.OverwriteSilently);
reader = new StreamReader(tempFile); reader = new StreamReader(tempFile);
InitializeFromReader(reader); InitializeFromReader(reader);
reader.Close(); reader.Close();
......
...@@ -43,10 +43,10 @@ namespace MDPro3.Duel.YGOSharp ...@@ -43,10 +43,10 @@ namespace MDPro3.Duel.YGOSharp
if (file.ToLower().EndsWith(".cdb")) if (file.ToLower().EndsWith(".cdb"))
{ {
var e = zip[file]; var e = zip[file];
if (!Directory.Exists(Program.tempFolder)) if (!Directory.Exists(Program.PATH_TEMP_FOLDER))
Directory.CreateDirectory(Program.tempFolder); Directory.CreateDirectory(Program.PATH_TEMP_FOLDER);
var tempFile = Path.Combine(Path.GetFullPath(Program.tempFolder), file); var tempFile = Path.Combine(Path.GetFullPath(Program.PATH_TEMP_FOLDER), file);
e.Extract(Path.GetFullPath(Program.tempFolder), ExtractExistingFileAction.OverwriteSilently); e.Extract(Path.GetFullPath(Program.PATH_TEMP_FOLDER), ExtractExistingFileAction.OverwriteSilently);
LoadCDB(tempFile, isPreCards : Path.GetFileName(zip.Name) == "ygopro-super-pre.ypk"); LoadCDB(tempFile, isPreCards : Path.GetFileName(zip.Name) == "ygopro-super-pre.ypk");
File.Delete(tempFile); File.Delete(tempFile);
} }
...@@ -76,10 +76,10 @@ namespace MDPro3.Duel.YGOSharp ...@@ -76,10 +76,10 @@ namespace MDPro3.Duel.YGOSharp
if (file.ToLower().EndsWith(".cdb")) if (file.ToLower().EndsWith(".cdb"))
{ {
var e = zip[file]; var e = zip[file];
if (!Directory.Exists(Program.tempFolder)) if (!Directory.Exists(Program.PATH_TEMP_FOLDER))
Directory.CreateDirectory(Program.tempFolder); Directory.CreateDirectory(Program.PATH_TEMP_FOLDER);
var tempFile = Path.Combine(Path.GetFullPath(Program.tempFolder), file); var tempFile = Path.Combine(Path.GetFullPath(Program.PATH_TEMP_FOLDER), file);
e.Extract(Path.GetFullPath(Program.tempFolder), ExtractExistingFileAction.OverwriteSilently); e.Extract(Path.GetFullPath(Program.PATH_TEMP_FOLDER), ExtractExistingFileAction.OverwriteSilently);
LoadCDB(tempFile, true, isPreCards: Path.GetFileName(zip.Name) == "ygopro-super-pre.ypk"); LoadCDB(tempFile, true, isPreCards: Path.GetFileName(zip.Name) == "ygopro-super-pre.ypk");
File.Delete(tempFile); File.Delete(tempFile);
} }
......
...@@ -39,10 +39,10 @@ namespace MDPro3 ...@@ -39,10 +39,10 @@ namespace MDPro3
if (file.ToLower().EndsWith(".cdb")) if (file.ToLower().EndsWith(".cdb"))
{ {
var e = zip[file]; var e = zip[file];
if (!Directory.Exists(Program.tempFolder)) if (!Directory.Exists(Program.PATH_TEMP_FOLDER))
Directory.CreateDirectory(Program.tempFolder); Directory.CreateDirectory(Program.PATH_TEMP_FOLDER);
var tempFile = Path.Combine(Path.GetFullPath(Program.tempFolder), file); var tempFile = Path.Combine(Path.GetFullPath(Program.PATH_TEMP_FOLDER), file);
e.Extract(Path.GetFullPath(Program.tempFolder), ExtractExistingFileAction.OverwriteSilently); e.Extract(Path.GetFullPath(Program.PATH_TEMP_FOLDER), ExtractExistingFileAction.OverwriteSilently);
returnValue.Add(tempFile); returnValue.Add(tempFile);
} }
} }
......
...@@ -267,15 +267,23 @@ namespace MDPro3 ...@@ -267,15 +267,23 @@ namespace MDPro3
#region MonoBehaviors #region MonoBehaviors
public const string tempFolder = "TempFolder/"; public const string PATH_ROOT_EDITOR = "Platforms/";
public const string rootWindows64 = "StandaloneWindows64/"; public const string PATH_ROOT_WINDOWS64 = "StandaloneWindows64/";
public const string rootAndroid = "Android/"; public const string PATH_ROOT_ANDROID = "Android/";
public static string root = rootWindows64; public const string PATH_ROOT_IOS = "iOS/";
public const string PATH_TEMP_FOLDER = "TempFolder/";
public static string root = PATH_ROOT_WINDOWS64;
void Awake() void Awake()
{ {
#if UNITY_ANDROID #if UNITY_ANDROID
root = rootAndroid; root = PATH_ROOT_ANDROID;
#elif UNITY_IOS
root = PATH_ROOT_IOS;
#endif
#if UNITY_EDITOR
root = PATH_ROOT_EDITOR + root;
#endif #endif
instance = this; instance = this;
Initialize(); Initialize();
...@@ -420,8 +428,8 @@ namespace MDPro3 ...@@ -420,8 +428,8 @@ namespace MDPro3
string cachePath = cacheDir.Call<string>("getAbsolutePath"); string cachePath = cacheDir.Call<string>("getAbsolutePath");
Tools.ClearDirectoryRecursively(new DirectoryInfo(cachePath)); Tools.ClearDirectoryRecursively(new DirectoryInfo(cachePath));
#else #else
if (Directory.Exists(tempFolder)) if (Directory.Exists(PATH_TEMP_FOLDER))
Directory.Delete(tempFolder, true); Directory.Delete(PATH_TEMP_FOLDER, true);
#endif #endif
} }
......
...@@ -462,7 +462,7 @@ namespace MDPro3.Servant ...@@ -462,7 +462,7 @@ namespace MDPro3.Servant
public void CameraZoomToMate0() public void CameraZoomToMate0()
{ {
if (Program.root == Program.rootAndroid) if (Program.root == Program.PATH_ROOT_ANDROID)
return; return;
if (Config.Get("MateViewTips", "0") == "0") if (Config.Get("MateViewTips", "0") == "0")
...@@ -487,7 +487,7 @@ namespace MDPro3.Servant ...@@ -487,7 +487,7 @@ namespace MDPro3.Servant
public void CameraZoomToMate1() public void CameraZoomToMate1()
{ {
if (Program.root == Program.rootAndroid) if (Program.root == Program.PATH_ROOT_ANDROID)
return; return;
if (Config.Get("MateViewTips", "0") == "0") if (Config.Get("MateViewTips", "0") == "0")
......
...@@ -136,9 +136,9 @@ namespace YgomGame.Bg ...@@ -136,9 +136,9 @@ namespace YgomGame.Bg
foreach(var ani in animator.parameters) foreach(var ani in animator.parameters)
animatorParams.Add(ani.name); animatorParams.Add(ani.name);
} }
if (disableLowEndPlatform && Program.root != Program.rootWindows64) if (disableLowEndPlatform && Program.root != Program.PATH_ROOT_WINDOWS64)
Destroy(gameObject); Destroy(gameObject);
if (enableLowEndPlatformOnly && Program.root == Program.rootWindows64) if (enableLowEndPlatformOnly && Program.root == Program.PATH_ROOT_WINDOWS64)
Destroy(gameObject); Destroy(gameObject);
if (playingOnlyActive) if (playingOnlyActive)
...@@ -147,12 +147,12 @@ namespace YgomGame.Bg ...@@ -147,12 +147,12 @@ namespace YgomGame.Bg
public bool PlayEffect(TriggerLabelDefine triggerLabel) public bool PlayEffect(TriggerLabelDefine triggerLabel)
{ {
if (disableLowEndPlatform && Program.root != Program.rootWindows64) if (disableLowEndPlatform && Program.root != Program.PATH_ROOT_WINDOWS64)
{ {
gameObject.SetActive(false); gameObject.SetActive(false);
return false; return false;
} }
if(enableLowEndPlatformOnly && Program.root == Program.rootWindows64) if(enableLowEndPlatformOnly && Program.root == Program.PATH_ROOT_WINDOWS64)
{ {
gameObject.SetActive(false); gameObject.SetActive(false);
return false; return false;
......
...@@ -23,9 +23,9 @@ namespace YgomSystem.UI.PropertyOverrider ...@@ -23,9 +23,9 @@ namespace YgomSystem.UI.PropertyOverrider
private void Start() private void Start()
{ {
if (m_Active.m_DefaultValue && Program.root != Program.rootWindows64) if (m_Active.m_DefaultValue && Program.root != Program.PATH_ROOT_WINDOWS64)
Destroy(gameObject); Destroy(gameObject);
if (m_Active.m_MobileValue && Program.root == Program.rootWindows64) if (m_Active.m_MobileValue && Program.root == Program.PATH_ROOT_WINDOWS64)
Destroy(gameObject); Destroy(gameObject);
} }
} }
......
This diff is collapsed.
...@@ -6,9 +6,13 @@ Unity version: 6000.0.10f1 ...@@ -6,9 +6,13 @@ Unity version: 6000.0.10f1
### Other required folders ### Other required folders
* Android: You can find it from the Android apk. * Platforms/Android: You can find it from the Android apk.
* StandaloneWindows64: You can find it from the released MDPro3(windows). * Platforms/StandaloneWindows64: You can find it from the released MDPro3(windows).
* Platforms/iOS: You can find it from the released MDPro3(iOS).
* Platforms/Mac: You can find it from the released MDPro3(Mac).
* Picture/Art: https://code.mycard.moe/mycard/hd-arts * Picture/Art: https://code.mycard.moe/mycard/hd-arts
......
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