Commit 5cf5390a authored by hex's avatar hex

1. Fixed lag issue on the settlement screen;

2. Fixed lag issue on the main screen;
3. Added EXP server and MYGO Early Access server to the server list;
4. Fixed issue where the "Settings" screen could not be closed when clicking rapidly;
5. Changed card addition from double-click to long-press (good news for those with tenosynovitis);
6. Standardized download code: now uses official asynchronous download method without affecting the main thread.
parent 17edb59b
Pipeline #37614 failed
using UnityEngine;
using System.Collections;
using System.Collections;
using UnityEngine;
public class cardPicLoader : MonoBehaviour
{
public int loaded_code = -1;
public int code = 0;
......@@ -45,7 +44,12 @@ public class cardPicLoader : MonoBehaviour
{
if (Program.pointedCollider == coli)
{
((CardDescription)(Program.I().cardDescription)).setData(YGOSharp.CardsManager.Get(code), GameTextureManager.myBack,"",true);
((CardDescription)(Program.I().cardDescription)).setData(
YGOSharp.CardsManager.Get(code),
GameTextureManager.myBack,
"",
true
);
}
}
}
......
using UnityEngine;
using System.Collections;
using System.Collections;
using UnityEngine;
public class descKeeper : MonoBehaviour {
public class descKeeper : MonoBehaviour
{
public UITexture card;
public UITexture back;
// Use this for initialization
void Start()
{
}
// Use this for initialization
void Start() { }
// Update is called once per frame
void Update () {
void Update()
{
if (back.width < card.width)
{
back.width = card.width + 2;
}
back.transform.localPosition = new Vector3(back.width / 2f, 0);
Vector3 leftTop = new Vector3(-back.width / 2 + 2 + back.transform.localPosition.x, +back.height / 2 - 2 + back.transform.localPosition.y);
card.transform.localPosition = new Vector3(leftTop.x + card.width / 2, leftTop.y - card.height / 2);
Program.I().cardDescription.width = back.width-2;
Vector3 leftTop = new Vector3(
-back.width / 2 + 2 + back.transform.localPosition.x,
+back.height / 2 - 2 + back.transform.localPosition.y
);
card.transform.localPosition = new Vector3(
leftTop.x + card.width / 2,
leftTop.y - card.height / 2
);
Program.I().cardDescription.width = back.width - 2;
Program.I().cardDescription.cHeight = card.height;
}
}
......@@ -301,11 +301,11 @@ Camera:
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
m_StereoMirrorMode: 0
--- !u!26 &2655262
ParticleRenderer:
m_ObjectHideFlags: 1
......@@ -315,6 +315,7 @@ ParticleRenderer:
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
......@@ -330,6 +331,7 @@ ParticleRenderer:
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
......@@ -357,6 +359,7 @@ ParticleRenderer:
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
......@@ -372,6 +375,7 @@ ParticleRenderer:
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
......@@ -503,8 +507,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
camera: {fileID: 2091536}
e1: {fileID: 1598580}
e2: {fileID: 1537834}
trans: {fileID: 497540}
--- !u!114 &11491940
MonoBehaviour:
......
using UnityEngine;
using System.Collections;
using System.Collections;
using UnityEngine;
public class mouseParticle : MonoBehaviour {
public class mouseParticle : MonoBehaviour
{
public Camera camera;
public EllipsoidParticleEmitter e1;
public EllipsoidParticleEmitter e2;
public Transform trans;
// Use this for initialization
void Start () {
void Start()
{
camera.depth = 99999;
}
float time = 0;
// Update is called once per frame
void Update () {
void Update()
{
Vector3 screenPoint = Input.mousePosition;
screenPoint.z = 10;
trans.position = camera.ScreenToWorldPoint(screenPoint);
......@@ -28,17 +33,9 @@ public class mouseParticle : MonoBehaviour {
{
time = 0.49f;
}
e1.maxEmission = (0.5f - time) * 60f;
e1.minEmission = (0.5f - time) * 60f;
e2.maxEmission = e1.maxEmission / 3f;
e2.minEmission = e1.minEmission / 3f;
e1.emit = true;
e2.emit = true;
}
else
{
e1.emit = false;
e2.emit = false;
}
}
}
This diff is collapsed.
using System;
using System.Collections.Generic;
using UnityEngine;
public static class GameStringManager
{
public class hashedString
......@@ -28,9 +29,7 @@ public static class GameStringManager
return_value = Int32.Parse(str);
}
}
catch (Exception)
{
}
catch (Exception) { }
return return_value;
}
......@@ -45,7 +44,8 @@ public static class GameStringManager
{
if (line.Length > 1 && line.Substring(0, 1) == "!")
{
string[] mats = line.Substring(1, line.Length - 1).Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
string[] mats = line.Substring(1, line.Length - 1)
.Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries);
if (mats.Length > 2)
{
found = true;
......@@ -66,7 +66,8 @@ public static class GameStringManager
a.content += mats[i] + " ";
}
a.content = a.content.Substring(0, a.content.Length - 1);
if(!test) {
if (!test)
{
hashedStrings.Add(a);
if (a.region == "setname")
{
......@@ -150,6 +151,7 @@ public static class GameStringManager
else
return "???";
}
internal static string formatLocation(GPS gps)
{
return formatLocation(gps.location, gps.sequence);
......
using System;
using System.Collections;
using System.IO;
using UnityEngine;
using UnityEngine.Networking;
/// <summary>
/// 使用Unity官方推荐的UnityWebRequest来异步下载文件。
/// </summary>
public class UnityFileDownloader
{
public static IEnumerator DownloadFileAsync(
string url,
string filePath,
Action<bool> onComplete,
Action<float> onProgress = null
)
{
string directoryPath = Path.GetDirectoryName(filePath);
if (!Directory.Exists(directoryPath))
{
Directory.CreateDirectory(directoryPath);
}
string tempFilePath = filePath + ".tmp";
if (File.Exists(tempFilePath))
{
File.Delete(tempFilePath);
}
using (UnityWebRequest uwr = new UnityWebRequest(url, UnityWebRequest.kHttpVerbGET))
{
uwr.downloadHandler = new DownloadHandlerFile(tempFilePath);
uwr.timeout = GetTimeoutForFile(filePath);
var asyncOperation = uwr.SendWebRequest();
while (!asyncOperation.isDone)
{
if (onProgress != null)
{
onProgress.Invoke(asyncOperation.progress);
}
yield return null;
}
if (!uwr.isNetworkError && !uwr.isHttpError)
{
if (File.Exists(filePath))
{
File.Delete(filePath);
}
File.Move(tempFilePath, filePath);
// 使用 string.Format 替换了插值字符串
Debug.Log(string.Format("下载成功: {0} -> {1}", url, filePath));
if (onComplete != null)
{
onComplete.Invoke(true);
}
}
else
{
// 使用 string.Format 替换了插值字符串
Debug.LogError(string.Format("下载失败: {0}\n错误信息: {1}", url, uwr.error));
if (File.Exists(tempFilePath))
{
File.Delete(tempFilePath);
}
if (onComplete != null)
{
onComplete.Invoke(false);
}
}
}
}
private static int GetTimeoutForFile(string filename)
{
string extension = Path.GetExtension(filename).ToLower();
switch (extension)
{
case ".png":
return 7;
case ".jpg":
return 4;
case ".cdb":
return 30;
case ".conf":
return 3;
default:
return 10;
}
}
}
fileFormatVersion: 2
guid: 25fa5ec13b1e84a41b335ddc22a05481
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
This diff is collapsed.
This diff is collapsed.
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