Commit dd3ad4b5 authored by SherryChaos's avatar SherryChaos

new multi platform struct

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