Commit 4694efba authored by hex's avatar hex

set default resolution to 1600x900

parent b8b5d27a
Pipeline #37628 failed
using UnityEngine;
using System;
using System;
using System.Collections.Generic;
using UnityEngine;
using YGOSharp.OCGWrapper.Enums;
public class CardDescription : Servant
......@@ -20,10 +20,9 @@ public class CardDescription : Servant
public override void initialize()
{
gameObject = create
(
gameObject = create(
Program.I().new_ui_cardDescription,
Program.camera_main_2d.ScreenToWorldPoint(new Vector3(-256, Screen.height /2, 600)),
Program.camera_main_2d.ScreenToWorldPoint(new Vector3(-256, Screen.height / 2, 600)),
new Vector3(0, 0, 0),
true,
Program.ui_back_ground_2d
......@@ -39,7 +38,7 @@ public class CardDescription : Servant
monitor = UIHelper.getByName<UIPanel>(gameObject, "monitor");
deckPanel = gameObject.GetComponentInChildren<UIDeckPanel>();
line = UIHelper.getByName(gameObject, "line");
UIHelper.registEvent(gameObject,"pre_", onPre);
UIHelper.registEvent(gameObject, "pre_", onPre);
UIHelper.registEvent(gameObject, "next_", onNext);
UIHelper.registEvent(gameObject, "big_", onb);
UIHelper.registEvent(gameObject, "small_", ons);
......@@ -47,11 +46,9 @@ public class CardDescription : Servant
lineSprite = UIHelper.getByName<UISprite>(gameObject, "line");
try
{
description.textLabel.fontSize = int.Parse(Config.Get("fontSize","24"));
}
catch (System.Exception e)
{
description.textLabel.fontSize = int.Parse(Config.Get("fontSize", "24"));
}
catch (System.Exception e) { }
read();
myGraveStr = InterString.Get("我方墓地:");
myExtraStr = InterString.Get("我方额外:");
......@@ -103,7 +100,13 @@ public class CardDescription : Servant
if (gameObject != null)
{
underSprite.height = Screen.height + 4;
iTween.MoveTo(gameObject, Program.camera_main_2d.ScreenToWorldPoint(new Vector3(-underSprite.width-20, Screen.height / 2, 0)), 1.2f);
iTween.MoveTo(
gameObject,
Program.camera_main_2d.ScreenToWorldPoint(
new Vector3(-underSprite.width - 20, Screen.height / 2, 0)
),
1.2f
);
setTitle("");
resizer.gameObject.GetComponent<BoxCollider>().enabled = false;
}
......@@ -114,7 +117,11 @@ public class CardDescription : Servant
if (gameObject != null)
{
underSprite.height = Screen.height + 4;
iTween.MoveTo(gameObject, Program.camera_main_2d.ScreenToWorldPoint(new Vector3(-2, Screen.height / 2, 0)), 1.2f);
iTween.MoveTo(
gameObject,
Program.camera_main_2d.ScreenToWorldPoint(new Vector3(-2, Screen.height / 2, 0)),
1.2f
);
resizer.gameObject.GetComponent<BoxCollider>().enabled = true;
}
}
......@@ -134,9 +141,7 @@ public class CardDescription : Servant
underSprite.width = ca;
picSprite.height = cb;
}
catch (System.Exception e)
{
}
catch (System.Exception e) { }
}
public void save()
......@@ -210,7 +215,13 @@ public class CardDescription : Servant
picLoader.loaded_code = -1;
currentCard = card;
shiftCardShower(true);
Program.go(50, () => { shiftCardShower(true); });
Program.go(
50,
() =>
{
shiftCardShower(true);
}
);
}
public void shiftCardShower(bool show)
......@@ -244,7 +255,6 @@ public class CardDescription : Servant
string opExtraStr = "";
string opBanishedStr = "";
public void realizeMonitor()
{
if (monitor.gameObject.activeInHierarchy)
......@@ -322,14 +332,18 @@ public class CardDescription : Servant
int eachLine = 0;
float monitorHeight = 0;
void handleMonitorArea(List<gameCard> list,string hint)
void handleMonitorArea(List<gameCard> list, string hint)
{
if (list.Count > 0)
{
deckPanel.labs[currentLabelIndex].gameObject.SetActive(true);
deckPanel.labs[currentLabelIndex].text = hint;
deckPanel.labs[currentLabelIndex].width = (int)(monitor.width - 12);
deckPanel.labs[currentLabelIndex].transform.localPosition = new Vector3(monitor.width / 2, (monitor.height - 8) / 2 - 12 - currentHeight, 0);
deckPanel.labs[currentLabelIndex].transform.localPosition = new Vector3(
monitor.width / 2,
(monitor.height - 8) / 2 - 12 - currentHeight,
0
);
currentLabelIndex++;
currentHeight += 24;
float beginX = 6 + 22;
......@@ -339,7 +353,11 @@ public class CardDescription : Servant
{
var gp = UIHelper.get_hang_lie(i, eachLine);
quickCards[currentCardIndex].reCode(list[i].get_data().Id);
quickCards[currentCardIndex].transform.localPosition = new Vector3(beginX + 44 * gp.y, beginY - 60 * gp.x, 0);
quickCards[currentCardIndex].transform.localPosition = new Vector3(
beginX + 44 * gp.y,
beginY - 60 * gp.x,
0
);
currentCardIndex++;
}
int hangshu = list.Count / eachLine;
......@@ -366,9 +384,9 @@ public class CardDescription : Servant
}
}
public void setData(YGOSharp.Card card, Texture2D def, string tail = "",bool force=false)
public void setData(YGOSharp.Card card, Texture2D def, string tail = "", bool force = false)
{
if (cardShowerWidget.alpha == 0&&force==false)
if (cardShowerWidget.alpha == 0 && force == false)
{
return;
}
......@@ -378,7 +396,7 @@ public class CardDescription : Servant
}
if (card.Id == 0)
{
apply(card,def,tail);
apply(card, def, tail);
return;
}
if (datas.Count > 0)
......@@ -389,7 +407,7 @@ public class CardDescription : Servant
{
card = card,
def = def,
tail = tail
tail = tail,
};
if (datas.Count > 300)
{
......@@ -400,13 +418,15 @@ public class CardDescription : Servant
return;
}
}
datas.Add(new data
datas.Add(
new data
{
card = card,
def = def,
tail = tail
});
if (datas.Count>300)
tail = tail,
}
);
if (datas.Count > 300)
{
datas.RemoveAt(0);
}
......@@ -416,7 +436,7 @@ public class CardDescription : Servant
public void setTitle(string title)
{
UIHelper.trySetLableText(gameObject,"title_",title);
UIHelper.trySetLableText(gameObject, "title_", title);
}
List<string> Logs = new List<string>();
......@@ -442,7 +462,7 @@ public class CardDescription : Servant
void clearOneLog()
{
if (Logs.Count>0)
if (Logs.Count > 0)
{
Logs.RemoveAt(0);
string all = "";
......@@ -454,17 +474,15 @@ public class CardDescription : Servant
{
all = all.Substring(0, all.Length - 1);
}
catch (System.Exception e)
{
}
catch (System.Exception e) { }
UIHelper.trySetLableTextList(UIHelper.getByName(gameObject, "chat_"), all);
}
else
{
UIHelper.trySetLableTextList(UIHelper.getByName(gameObject, "chat_"), "");
}
}
public void clearAllLog()
{
Program.notGo(clearOneLog);
......
......@@ -51,7 +51,6 @@ public class UnityFileDownloader
File.Delete(filePath);
}
File.Move(tempFilePath, filePath);
// 使用 string.Format 替换了插值字符串
Debug.Log(string.Format("下载成功: {0} -> {1}", url, filePath));
if (onComplete != null)
......@@ -61,7 +60,6 @@ public class UnityFileDownloader
}
else
{
// 使用 string.Format 替换了插值字符串
Debug.LogError(string.Format("下载失败: {0}\n错误信息: {1}", url, uwr.error));
if (File.Exists(tempFilePath))
{
......
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