Commit ee086d1e authored by 神楽坂玲奈's avatar 神楽坂玲奈

new GameTextureManager, unity 2021.2 beta for async read file.

parent 9974ccde
...@@ -7,33 +7,35 @@ public class MonoCardInDeckManager : MonoBehaviour ...@@ -7,33 +7,35 @@ public class MonoCardInDeckManager : MonoBehaviour
public bool dying; public bool dying;
private bool bool_physicalON; private bool bool_physicalON;
public Card cardData = new Card(); private Card _cardData = new();
private bool died; private bool died;
private bool isDraging; private bool isDraging;
private Banlist loaded_banlist; private Banlist loaded_banlist;
private int loadedPicCode;
private void Update() public Card cardData
{ {
if (loadedPicCode != cardData.Id) get => _cardData;
set
{ {
var pic = GameTextureManager.get(cardData.Id, GameTextureType.card_picture); _cardData = value;
if (pic != null) LoadCard();
{
loadedPicCode = cardData.Id;
gameObject.transform.Find("face").GetComponent<Renderer>().material.mainTexture = pic;
}
} }
}
private async void LoadCard()
{
gameObject.transform.Find("face").GetComponent<Renderer>().material.mainTexture =
await GameTextureManager.GetCardPicture(_cardData.Id);
}
private void Update()
{
if (Program.I().deckManager.currentBanlist != loaded_banlist) if (Program.I().deckManager.currentBanlist != loaded_banlist)
{ {
var ico = GetComponentInChildren<ban_icon>(); var ico = GetComponentInChildren<ban_icon>();
loaded_banlist = Program.I().deckManager.currentBanlist; loaded_banlist = Program.I().deckManager.currentBanlist;
if (loaded_banlist != null) ico.show(loaded_banlist?.GetQuantity(_cardData.Id) ?? 3);
ico.show(loaded_banlist.GetQuantity(cardData.Id));
else
ico.show(3);
} }
if (isDraging) gameObject.transform.position += (getGoodPosition(4) - gameObject.transform.position) * 0.3f; if (isDraging) gameObject.transform.position += (getGoodPosition(4) - gameObject.transform.position) * 0.3f;
......
...@@ -3,43 +3,40 @@ using YGOSharp; ...@@ -3,43 +3,40 @@ using YGOSharp;
public class cardPicLoader : MonoBehaviour public class cardPicLoader : MonoBehaviour
{ {
public int loaded_code = -1; private int _code;
public int code;
public Texture2D defaults; public Texture2D defaults;
public ban_icon ico; public ban_icon ico;
public Collider coli; public Collider coli;
public UITexture uiTexture; public UITexture uiTexture;
public Banlist loaded_banlist; public Banlist loaded_banlist;
public Card data { get; set; } public Card data { get; set; }
public int code
{
get => _code;
set
{
_code = value;
LoadCard();
}
}
private async void LoadCard()
{
Debug.Log(code);
uiTexture.mainTexture = await GameTextureManager.GetCardPicture(code);
if (uiTexture.mainTexture == null) return;
uiTexture.aspectRatio = (float) uiTexture.mainTexture.width / uiTexture.mainTexture.height;
uiTexture.forceWidth((int) (uiTexture.height * uiTexture.aspectRatio));
loaded_banlist = null;
}
private void Update() private void Update()
{ {
if (coli != null) if (coli != null && Program.InputGetMouseButtonDown_0 && Program.pointedCollider == coli)
if (Program.InputGetMouseButtonDown_0) Program.I().cardDescription.setData(CardsManager.Get(_code), GameTextureManager.myBack, "", true);
if (Program.pointedCollider == coli)
Program.I().cardDescription.setData(CardsManager.Get(code), GameTextureManager.myBack, "", true);
if (Program.I().deckManager != null) if (Program.I().deckManager != null)
{ {
if (loaded_code != code)
{
var t = GameTextureManager.get(code, GameTextureType.card_picture, defaults);
if (t != null)
{
uiTexture.mainTexture = t;
uiTexture.aspectRatio = t.width / (float) t.height;
uiTexture.forceWidth((int) (uiTexture.height * uiTexture.aspectRatio));
loaded_code = code;
loaded_banlist = null;
}
}
if (loaded_banlist != Program.I().deckManager.currentBanlist) if (loaded_banlist != Program.I().deckManager.currentBanlist)
{ {
loaded_banlist = Program.I().deckManager.currentBanlist; loaded_banlist = Program.I().deckManager.currentBanlist;
...@@ -51,7 +48,7 @@ public class cardPicLoader : MonoBehaviour ...@@ -51,7 +48,7 @@ public class cardPicLoader : MonoBehaviour
return; return;
} }
ico.show(loaded_banlist.GetQuantity(code)); ico.show(loaded_banlist.GetQuantity(_code));
} }
} }
} }
...@@ -59,18 +56,11 @@ public class cardPicLoader : MonoBehaviour ...@@ -59,18 +56,11 @@ public class cardPicLoader : MonoBehaviour
public void clear() public void clear()
{ {
loaded_code = 0; _code = 0;
code = 0;
ico.show(3); ico.show(3);
uiTexture.mainTexture = null; uiTexture.mainTexture = null;
} }
public void reCode(int c)
{
loaded_code = 0;
code = c;
}
public void relayer(int l) public void relayer(int l)
{ {
uiTexture.depth = 50 + l * 2; uiTexture.depth = 50 + l * 2;
......
...@@ -12,9 +12,9 @@ public class handShower : MonoBehaviour ...@@ -12,9 +12,9 @@ public class handShower : MonoBehaviour
private void Start() private void Start()
{ {
pics[0] = GameTextureManager.get("jiandao"); pics[0] = GameTextureManager.GetUI("jiandao");
pics[1] = GameTextureManager.get("shitou"); pics[1] = GameTextureManager.GetUI("shitou");
pics[2] = GameTextureManager.get("bu"); pics[2] = GameTextureManager.GetUI("bu");
texture_0.mainTexture = pics[me]; texture_0.mainTexture = pics[me];
texture_1.mainTexture = pics[op]; texture_1.mainTexture = pics[op];
GameObject_0.transform.position = Program.I().camera_main_2d GameObject_0.transform.position = Program.I().camera_main_2d
......
...@@ -33,7 +33,7 @@ public class UITextureInspector : UIBasicSpriteEditor ...@@ -33,7 +33,7 @@ public class UITextureInspector : UIBasicSpriteEditor
startPath = sp2.stringValue; startPath = sp2.stringValue;
if (startPath != "") if (startPath != "")
{ {
mTex.mainTexture = UIHelper.getTexture2D("texture/ui/" + startPath + ".png"); mTex.mainTexture = UIHelper.GetTexture2D("texture/ui/" + startPath + ".png");
} }
Debug.Log("force delay read"); Debug.Log("force delay read");
} }
......
...@@ -107,7 +107,7 @@ public class UITexturePacker ...@@ -107,7 +107,7 @@ public class UITexturePacker
storage[i].paddingY = (yPadding != 0); storage[i].paddingY = (yPadding != 0);
} }
texture.Resize(width, height); texture.Reinitialize(width, height);
texture.SetPixels(new Color[width * height]); texture.SetPixels(new Color[width * height]);
// The returned rects // The returned rects
......
...@@ -329,14 +329,14 @@ public class UIButton : UIButtonColor ...@@ -329,14 +329,14 @@ public class UIButton : UIButtonColor
case State.Normal: case State.Normal:
if (mTextureOutNormal != "") if (mTextureOutNormal != "")
{ {
texure2d.mainTexture = GameTextureManager.get(mTextureOutNormal); texure2d.mainTexture = GameTextureManager.GetUI(mTextureOutNormal);
} }
break; break;
case State.Hover: case State.Hover:
case State.Pressed: case State.Pressed:
if (mTextureOutPressed != "") if (mTextureOutPressed != "")
{ {
texure2d.mainTexture = GameTextureManager.get(mTextureOutPressed); texure2d.mainTexture = GameTextureManager.GetUI(mTextureOutPressed);
} }
break; break;
} }
......
...@@ -46,10 +46,7 @@ public class UITexture : UIBasicSprite ...@@ -46,10 +46,7 @@ public class UITexture : UIBasicSprite
protected override void OnStart() protected override void OnStart()
{ {
base.OnStart(); base.OnStart();
if (mOutPath != "") if (!string.IsNullOrEmpty(mOutPath)) mainTexture = GameTextureManager.GetUI(mOutPath);
{
mainTexture = GameTextureManager.get(mOutPath);
}
} }
public override Texture mainTexture public override Texture mainTexture
......
fileFormatVersion: 2
guid: f53581fb80be96f46b0cb1a267158562
timeCreated: 1480605668
licenseType: Pro
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
...@@ -211,7 +211,6 @@ public class CardDescription : Servant ...@@ -211,7 +211,6 @@ public class CardDescription : Servant
picLoader.code = card.Id; picLoader.code = card.Id;
picLoader.defaults = def; picLoader.defaults = def;
picLoader.loaded_code = -1;
currentCard = card; currentCard = card;
shiftCardShower(true); shiftCardShower(true);
Program.go(50, () => { shiftCardShower(true); }); Program.go(50, () => { shiftCardShower(true); });
...@@ -310,7 +309,7 @@ public class CardDescription : Servant ...@@ -310,7 +309,7 @@ public class CardDescription : Servant
for (var i = 0; i < list.Count; i++) for (var i = 0; i < list.Count; i++)
{ {
var gp = UIHelper.get_hang_lie(i, eachLine); var gp = UIHelper.get_hang_lie(i, eachLine);
quickCards[currentCardIndex].reCode(list[i].get_data().Id); quickCards[currentCardIndex].code = list[i].get_data().Id;
quickCards[currentCardIndex].transform.localPosition = quickCards[currentCardIndex].transform.localPosition =
new Vector3(beginX + 44 * gp.y, beginY - 60 * gp.x, 0); new Vector3(beginX + 44 * gp.y, beginY - 60 * gp.x, 0);
currentCardIndex++; currentCardIndex++;
......
...@@ -3,8 +3,10 @@ using System.Collections.Generic; ...@@ -3,8 +3,10 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
using UnityEngine.Rendering; using UnityEngine.Rendering;
using YGOSharp.OCGWrapper.Enums; using YGOSharp.OCGWrapper.Enums;
...@@ -703,7 +705,7 @@ public static class UIHelper ...@@ -703,7 +705,7 @@ public static class UIHelper
if (!faces.ContainsKey(name)) if (!faces.ContainsKey(name))
try try
{ {
faces.Add(name, getTexture2D("texture/face/" + fileInfos[i].Name)); faces.Add(name, GetTexture2D("texture/face/" + fileInfos[i].Name));
} }
catch (Exception e) catch (Exception e)
{ {
...@@ -730,30 +732,19 @@ public static class UIHelper ...@@ -730,30 +732,19 @@ public static class UIHelper
return Program.I().face.faces[sum]; return Program.I().face.faces[sum];
} }
public static Texture2D getTexture2D(string path) public static Texture2D GetTexture2D(string path)
{ {
Texture2D pic = null; var pic = new Texture2D(0, 0);
try pic.LoadImage(File.ReadAllBytes(path));
{
if (!File.Exists(path)) return null;
var file = new FileStream(path, FileMode.Open, FileAccess.Read);
file.Seek(0, SeekOrigin.Begin);
var data = new byte[file.Length];
file.Read(data, 0, (int) file.Length);
file.Close();
file.Dispose();
file = null;
pic = new Texture2D(1024, 600);
pic.LoadImage(data);
}
catch (Exception e)
{
Debug.Log(e);
}
return pic; return pic;
} }
public static async Task<Texture2D> GetTexture2DAsync(string path)
{
var pic = new Texture2D(0, 0);
pic.LoadImage(await File.ReadAllBytesAsync(path));
return pic;
}
internal static void shiftButton(UIButton btn, bool enabled) internal static void shiftButton(UIButton btn, bool enabled)
{ {
......
...@@ -176,7 +176,7 @@ public class GameField : OCGobject ...@@ -176,7 +176,7 @@ public class GameField : OCGobject
{ {
if (File.Exists("texture/duel/field.png")) if (File.Exists("texture/duel/field.png"))
{ {
var textureField = UIHelper.getTexture2D("texture/duel/field.png"); var textureField = UIHelper.GetTexture2D("texture/duel/field.png");
var textureFieldSliced = UIHelper.sliceField(textureField); var textureFieldSliced = UIHelper.sliceField(textureField);
leftT.mainTexture = textureFieldSliced[0]; leftT.mainTexture = textureFieldSliced[0];
midT.mainTexture = textureFieldSliced[1]; midT.mainTexture = textureFieldSliced[1];
...@@ -197,7 +197,7 @@ public class GameField : OCGobject ...@@ -197,7 +197,7 @@ public class GameField : OCGobject
{ {
if (File.Exists("texture/duel/newfield.png")) if (File.Exists("texture/duel/newfield.png"))
{ {
var textureField = UIHelper.getTexture2D("texture/duel/newfield.png"); var textureField = UIHelper.GetTexture2D("texture/duel/newfield.png");
var textureFieldSliced = UIHelper.sliceField(textureField); var textureFieldSliced = UIHelper.sliceField(textureField);
leftT.mainTexture = textureFieldSliced[0]; leftT.mainTexture = textureFieldSliced[0];
midT.mainTexture = textureFieldSliced[1]; midT.mainTexture = textureFieldSliced[1];
...@@ -494,8 +494,8 @@ public class GameField : OCGobject ...@@ -494,8 +494,8 @@ public class GameField : OCGobject
break; break;
} }
if (tex == null) tex = UIHelper.getTexture2D("picture/field/" + code + ".png"); if (tex == null) tex = UIHelper.GetTexture2D("picture/field/" + code + ".png");
if (tex == null) tex = UIHelper.getTexture2D("picture/field/" + code + ".jpg"); if (tex == null) tex = UIHelper.GetTexture2D("picture/field/" + code + ".jpg");
if (tex != null) if (tex != null)
{ {
UIHelper.getByName<UITexture>(gameObject, "field_" + player).mainTexture = tex; UIHelper.getByName<UITexture>(gameObject, "field_" + player).mainTexture = tex;
......
...@@ -55,7 +55,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -55,7 +55,7 @@ public class Ocgcore : ServantWithCardDescription
private readonly List<gameCard> cardsSelected = new List<gameCard>(); private readonly List<gameCard> cardsSelected = new List<gameCard>();
private bool clearAllShowedB; private bool clearAllShowedB;
private bool clearTimeFlag; private bool clearTimeFlag;
private long code_for_show; private int code_for_show;
public Condition condition = Condition.duel; public Condition condition = Condition.duel;
public List<string> confirmedCards = new List<string>(); public List<string> confirmedCards = new List<string>();
...@@ -474,11 +474,11 @@ public class Ocgcore : ServantWithCardDescription ...@@ -474,11 +474,11 @@ public class Ocgcore : ServantWithCardDescription
Arrow.gameObject.SetActive(false); Arrow.gameObject.SetActive(false);
replayShowAll = Config.Get("replayShowAll", "0") != "0"; replayShowAll = Config.Get("replayShowAll", "0") != "0";
reportShowAll = Config.Get("reportShowAll", "0") != "0"; reportShowAll = Config.Get("reportShowAll", "0") != "0";
gameInfo = Program.I().new_ui_gameInfo; gameInfo = Program.I().new_ui_gameInfo;
gameInfo.ini(); gameInfo.ini();
UIHelper.InterGameObject(gameInfo.gameObject); UIHelper.InterGameObject(gameInfo.gameObject);
shiftCondition(Condition.duel); shiftCondition(Condition.duel);
...@@ -7586,7 +7586,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -7586,7 +7586,7 @@ public class Ocgcore : ServantWithCardDescription
if (leftExcited) if (leftExcited)
if (Input.GetKey(KeyCode.A) == false) if (Input.GetKey(KeyCode.A) == false)
leftExcited = false; leftExcited = false;
//gameInfo.keepChain_set(false); //gameInfo.keepChain_set(false);
} }
base.ES_mouseUpEmpty(); base.ES_mouseUpEmpty();
...@@ -7603,7 +7603,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -7603,7 +7603,7 @@ public class Ocgcore : ServantWithCardDescription
if (leftExcited) if (leftExcited)
if (Input.GetKey(KeyCode.A) == false) if (Input.GetKey(KeyCode.A) == false)
leftExcited = false; leftExcited = false;
//gameInfo.keepChain_set(false); //gameInfo.keepChain_set(false);
base.ES_mouseUpGameObject(gameObject); base.ES_mouseUpGameObject(gameObject);
} }
...@@ -7613,7 +7613,7 @@ public class Ocgcore : ServantWithCardDescription ...@@ -7613,7 +7613,7 @@ public class Ocgcore : ServantWithCardDescription
if (rightExcited) if (rightExcited)
if (Input.GetKey(KeyCode.S) == false) if (Input.GetKey(KeyCode.S) == false)
rightExcited = false; rightExcited = false;
//gameInfo.ignoreChain_set(false); //gameInfo.ignoreChain_set(false);
if (gameInfo.queryHashedButton("sendSelected")) if (gameInfo.queryHashedButton("sendSelected"))
{ {
sendSelectedCards(); sendSelectedCards();
...@@ -7655,37 +7655,23 @@ public class Ocgcore : ServantWithCardDescription ...@@ -7655,37 +7655,23 @@ public class Ocgcore : ServantWithCardDescription
target.animation_confirm_screenCenter(new Vector3(-30, 0, 0), 0.2f, 0.5f); target.animation_confirm_screenCenter(new Vector3(-30, 0, 0), 0.2f, 0.5f);
} }
public void animation_show_card_code(long code) public void animation_show_card_code(int code)
{ {
code_for_show = code; code_for_show = code;
AddUpdateAction_s(animation_show_card_code_handler); animation_show_card_code_handler();
Sleep(30); Sleep(30);
} }
private void animation_show_card_code_handler() private async void animation_show_card_code_handler()
{ {
var texture = GameTextureManager.get(code_for_show, GameTextureType.card_picture); var shower =
if (texture != null) create(Program.I().Pro1_CardShower, Program.I().ocgcore.centre(), Vector3.zero, false,
{ Program.I().ui_main_2d).GetComponent<pro1CardShower>();
RemoveUpdateAction_s(animation_show_card_code_handler); shower.card.mainTexture = await GameTextureManager.GetCardPicture(code_for_show);
//Vector3 position = Program.I().main_camera.ScreenToWorldPoint(new Vector3(getScreenCenter(), Screen.height / 2f, 10)); shower.mask.mainTexture = GameTextureManager.Mask;
//GameObject obj = create_s(Program.I().mod_simple_quad); shower.disable.mainTexture = GameTextureManager.negated;
//obj.AddComponent<animation_screen_lock>().screen_point = new Vector3(getScreenCenter(), Screen.height / 2f, 6); shower.gameObject.transform.localScale = Utils.UIHeight() / 650f * Vector3.one;
//obj.transform.eulerAngles = new Vector3(60, 0, 0); destroy(shower.gameObject, 0.5f);
//obj.GetComponent<Renderer>().material.mainTexture = texture;
//obj.transform.localPosition = position;
//obj.transform.localScale = new Vector3(3.2f, 4.6f, 1f);
//destroy(obj, 1f);
var shower =
create(Program.I().Pro1_CardShower, Program.I().ocgcore.centre(), Vector3.zero, false,
Program.I().ui_main_2d).GetComponent<pro1CardShower>();
shower.card.mainTexture = texture;
shower.mask.mainTexture = GameTextureManager.Mask;
shower.disable.mainTexture = GameTextureManager.negated;
shower.gameObject.transform.localScale =
new Vector3(Screen.height / 650f, Screen.height / 650f, Screen.height / 650f);
destroy(shower.gameObject, 0.5f);
}
} }
private class linkMask private class linkMask
......
...@@ -261,7 +261,7 @@ public class selectDeck : WindowServantSP ...@@ -261,7 +261,7 @@ public class selectDeck : WindowServantSP
private void printSelected() private void printSelected()
{ {
GameTextureManager.clearUnloaded(); // GameTextureManager.clearUnloaded();
Deck deck; Deck deck;
DeckManager.FromYDKtoCodedDeck("deck/" + deckSelected + ".ydk", out deck); DeckManager.FromYDKtoCodedDeck("deck/" + deckSelected + ".ydk", out deck);
var mainAll = 0; var mainAll = 0;
...@@ -287,7 +287,7 @@ public class selectDeck : WindowServantSP ...@@ -287,7 +287,7 @@ public class selectDeck : WindowServantSP
if ((c.Type & (uint) CardType.Monster) > 0) mainMonster++; if ((c.Type & (uint) CardType.Monster) > 0) mainMonster++;
if ((c.Type & (uint) CardType.Spell) > 0) mainSpell++; if ((c.Type & (uint) CardType.Spell) > 0) mainSpell++;
if ((c.Type & (uint) CardType.Trap) > 0) mainTrap++; if ((c.Type & (uint) CardType.Trap) > 0) mainTrap++;
quickCards[currentIndex].reCode(item); quickCards[currentIndex].code = item;
var v = UIHelper.get_hang_lieArry(mainAll - 1, hangshu); var v = UIHelper.get_hang_lieArry(mainAll - 1, hangshu);
quickCards[currentIndex].transform.localPosition = new Vector3 quickCards[currentIndex].transform.localPosition = new Vector3
( (
...@@ -307,7 +307,7 @@ public class selectDeck : WindowServantSP ...@@ -307,7 +307,7 @@ public class selectDeck : WindowServantSP
if ((c.Type & (uint) CardType.Monster) > 0) sideMonster++; if ((c.Type & (uint) CardType.Monster) > 0) sideMonster++;
if ((c.Type & (uint) CardType.Spell) > 0) sideSpell++; if ((c.Type & (uint) CardType.Spell) > 0) sideSpell++;
if ((c.Type & (uint) CardType.Trap) > 0) sideTrap++; if ((c.Type & (uint) CardType.Trap) > 0) sideTrap++;
quickCards[currentIndex].reCode(item); quickCards[currentIndex].code = item;
quickCards[currentIndex].transform.localPosition = new Vector3 quickCards[currentIndex].transform.localPosition = new Vector3
( (
-176.3f + UIHelper.get_left_right_indexZuo(0, 352f, sideAll - 1, deck.Side.Count, 10) -176.3f + UIHelper.get_left_right_indexZuo(0, 352f, sideAll - 1, deck.Side.Count, 10)
...@@ -327,7 +327,7 @@ public class selectDeck : WindowServantSP ...@@ -327,7 +327,7 @@ public class selectDeck : WindowServantSP
if ((c.Type & (uint) CardType.Synchro) > 0) extraSync++; if ((c.Type & (uint) CardType.Synchro) > 0) extraSync++;
if ((c.Type & (uint) CardType.Xyz) > 0) extraXyz++; if ((c.Type & (uint) CardType.Xyz) > 0) extraXyz++;
if ((c.Type & (uint) CardType.Link) > 0) extraLink++; if ((c.Type & (uint) CardType.Link) > 0) extraLink++;
quickCards[currentIndex].reCode(item); quickCards[currentIndex].code = item;
quickCards[currentIndex].transform.localPosition = new Vector3 quickCards[currentIndex].transform.localPosition = new Vector3
( (
-176.3f + UIHelper.get_left_right_indexZuo(0, 352f, extraAll - 1, deck.Extra.Count, 10) -176.3f + UIHelper.get_left_right_indexZuo(0, 352f, extraAll - 1, deck.Extra.Count, 10)
......
...@@ -644,12 +644,12 @@ public class Servant ...@@ -644,12 +644,12 @@ public class Servant
defbutton.transform.localPosition = new Vector3(62.8f, 0f, 0f); defbutton.transform.localPosition = new Vector3(62.8f, 0f, 0f);
} }
var cardPicLoader_ = currentMSwindow.AddComponent<cardPicLoader>(); var cardPicLoader = currentMSwindow.AddComponent<cardPicLoader>();
cardPicLoader_.code = code; cardPicLoader.uiTexture = atkpic;
cardPicLoader_.uiTexture = atkpic; cardPicLoader.code = code;
cardPicLoader_ = currentMSwindow.AddComponent<cardPicLoader>(); cardPicLoader = currentMSwindow.AddComponent<cardPicLoader>();
cardPicLoader_.code = int.Parse(def.value) == (int) CardPosition.FaceDownDefence ? 0 : code; cardPicLoader.uiTexture = UIHelper.getByName<UITexture>(currentMSwindow, "defPic_");
cardPicLoader_.uiTexture = UIHelper.getByName<UITexture>(currentMSwindow, "defPic_"); cardPicLoader.code = int.Parse(def.value) == (int) CardPosition.FaceDownDefence ? 0 : code;
} }
public void RMSshow_tp(string hashCode, messageSystemValue jiandao, messageSystemValue shitou, public void RMSshow_tp(string hashCode, messageSystemValue jiandao, messageSystemValue shitou,
......
...@@ -799,19 +799,18 @@ public class DeckManager : ServantWithCardDescription ...@@ -799,19 +799,18 @@ public class DeckManager : ServantWithCardDescription
}); });
} }
private GameObject itemOnListProducer(string[] Args) private GameObject itemOnListProducer(string[] args)
{ {
GameObject returnValue = null; var returnValue = create(Program.I().new_ui_cardOnSearchList, Vector3.zero, Vector3.zero, false,
returnValue = create(Program.I().new_ui_cardOnSearchList, Vector3.zero, Vector3.zero, false,
Program.I().ui_back_ground_2d); Program.I().ui_back_ground_2d);
UIHelper.getRealEventGameObject(returnValue).name = Args[0]; UIHelper.getRealEventGameObject(returnValue).name = args[0];
UIHelper.trySetLableText(returnValue, Args[2]); UIHelper.trySetLableText(returnValue, args[2]);
var cardPicLoader_ = UIHelper.getRealEventGameObject(returnValue).AddComponent<cardPicLoader>(); var cardPicLoader = UIHelper.getRealEventGameObject(returnValue).AddComponent<cardPicLoader>();
cardPicLoader_.code = int.Parse(Args[0]); cardPicLoader.uiTexture = UIHelper.getByName<UITexture>(returnValue, "pic_");
cardPicLoader_.data = CardsManager.Get(int.Parse(Args[0])); cardPicLoader.code = int.Parse(args[0]);
cardPicLoader_.uiTexture = UIHelper.getByName<UITexture>(returnValue, "pic_"); cardPicLoader.data = CardsManager.Get(int.Parse(args[0]));
cardPicLoader_.ico = UIHelper.getByName<ban_icon>(returnValue); cardPicLoader.ico = UIHelper.getByName<ban_icon>(returnValue);
cardPicLoader_.ico.show(3); cardPicLoader.ico.show(3);
return returnValue; return returnValue;
} }
......
...@@ -20,12 +20,12 @@ public class ban_icon : MonoBehaviour ...@@ -20,12 +20,12 @@ public class ban_icon : MonoBehaviour
UITexture t = gameObject.GetComponent<UITexture>(); UITexture t = gameObject.GetComponent<UITexture>();
if (t != null) if (t != null)
{ {
t.mainTexture = GameTextureManager.get("ban_" + i.ToString()); t.mainTexture = GameTextureManager.GetUI("ban_" + i.ToString());
} }
else else
{ {
Renderer r = GetComponent<Renderer>(); Renderer r = GetComponent<Renderer>();
r.material.mainTexture = GameTextureManager.get("ban_" + i.ToString()); r.material.mainTexture = GameTextureManager.GetUI("ban_" + i.ToString());
} }
} }
} }
...@@ -60,6 +60,7 @@ TextureImporter: ...@@ -60,6 +60,7 @@ TextureImporter:
streamingMipmaps: 0 streamingMipmaps: 0
streamingMipmapsPriority: 0 streamingMipmapsPriority: 0
vTOnly: 0 vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 6 generateCubemap: 6
cubemapConvolution: 0 cubemapConvolution: 0
...@@ -376,6 +377,19 @@ TextureImporter: ...@@ -376,6 +377,19 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
nameFileIdTable:
all_button_6: 21300012
all_button_3: 21300006
all_button_4: 21300008
all_button_11: 21300022
all_button_2: 21300004
all_button_1: 21300002
all_button_10: 21300020
all_button_8: 21300016
all_button_7: 21300014
all_button_0: 21300000
all_button_5: 21300010
all_button_9: 21300018
spritePackingTag: button_ocgcore spritePackingTag: button_ocgcore
pSDRemoveMatte: 0 pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0 pSDShowRemoveMatteOption: 0
......
...@@ -144,6 +144,7 @@ TextureImporter: ...@@ -144,6 +144,7 @@ TextureImporter:
streamingMipmaps: 0 streamingMipmaps: 0
streamingMipmapsPriority: 0 streamingMipmapsPriority: 0
vTOnly: 0 vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 6 generateCubemap: 6
cubemapConvolution: 0 cubemapConvolution: 0
...@@ -1048,6 +1049,47 @@ TextureImporter: ...@@ -1048,6 +1049,47 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
nameFileIdTable:
num_29: 21300058
num_2: 21300004
num_18: 21300036
num_25: 21300050
num_10: 21300020
num_19: 21300038
num_15: 21300030
num_20: 21300040
num_38: 21300076
num_3: 21300006
num_30: 21300060
num_16: 21300032
num_1: 21300002
num_37: 21300074
num_22: 21300044
num_11: 21300022
num_26: 21300052
num_39: 21300078
num_0: 21300000
num_23: 21300046
num_32: 21300064
num_9: 21300018
num_14: 21300028
num_27: 21300054
num_24: 21300048
num_12: 21300024
num_5: 21300010
num_21: 21300042
num_34: 21300068
num_31: 21300062
num_8: 21300016
num_28: 21300056
num_17: 21300034
num_13: 21300026
num_36: 21300072
num_6: 21300012
num_33: 21300066
num_35: 21300070
num_7: 21300014
num_4: 21300008
spritePackingTag: ocgcore_numbers spritePackingTag: ocgcore_numbers
pSDRemoveMatte: 0 pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0 pSDShowRemoveMatteOption: 0
......
...@@ -84,6 +84,7 @@ TextureImporter: ...@@ -84,6 +84,7 @@ TextureImporter:
streamingMipmaps: 0 streamingMipmaps: 0
streamingMipmapsPriority: 0 streamingMipmapsPriority: 0
vTOnly: 0 vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 6 generateCubemap: 6
cubemapConvolution: 0 cubemapConvolution: 0
...@@ -568,6 +569,27 @@ TextureImporter: ...@@ -568,6 +569,27 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
nameFileIdTable:
num2_11: 21300022
num2_6: 21300012
num2_8: 21300016
num2_9: 21300018
num2_5: 21300010
num2_17: 21300034
num2_18: 21300036
num2_1: 21300002
num2_0: 21300000
num2_12: 21300024
num2_10: 21300020
num2_14: 21300028
num2_15: 21300030
num2_4: 21300008
num2_19: 21300038
num2_13: 21300026
num2_16: 21300032
num2_3: 21300006
num2_2: 21300004
num2_7: 21300014
spritePackingTag: num2 spritePackingTag: num2
pSDRemoveMatte: 0 pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0 pSDShowRemoveMatteOption: 0
......
...@@ -75,6 +75,7 @@ TextureImporter: ...@@ -75,6 +75,7 @@ TextureImporter:
streamingMipmaps: 0 streamingMipmaps: 0
streamingMipmapsPriority: 0 streamingMipmapsPriority: 0
vTOnly: 0 vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0 grayScaleToAlpha: 0
generateCubemap: 6 generateCubemap: 6
cubemapConvolution: 0 cubemapConvolution: 0
...@@ -349,6 +350,17 @@ TextureImporter: ...@@ -349,6 +350,17 @@ TextureImporter:
edges: [] edges: []
weights: [] weights: []
secondaryTextures: [] secondaryTextures: []
nameFileIdTable:
Default Sprite Atlas_8: 21300030
Default Sprite Atlas_6: 21300016
Default Sprite Atlas_2: 21300010
Default Sprite Atlas_3: 21300006
Default Sprite Atlas_5: 21300026
Default Sprite Atlas_7: 21300028
Default Sprite Atlas_9: 21300032
Default Sprite Atlas_0: 21300024
Default Sprite Atlas_1: 21300020
Default Sprite Atlas_4: 21300022
spritePackingTag: spritePackingTag:
pSDRemoveMatte: 1 pSDRemoveMatte: 1
pSDShowRemoveMatteOption: 1 pSDShowRemoveMatteOption: 1
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"com.unity.ide.visualstudio": "2.0.11", "com.unity.ide.visualstudio": "2.0.11",
"com.unity.ide.vscode": "1.2.3", "com.unity.ide.vscode": "1.2.3",
"com.unity.test-framework": "1.1.27", "com.unity.test-framework": "1.1.27",
"com.unity.timeline": "1.5.6", "com.unity.timeline": "1.6.1",
"com.unity.ugui": "1.0.0", "com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0", "com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0", "com.unity.modules.androidjni": "1.0.0",
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
"url": "https://packages.unity.com" "url": "https://packages.unity.com"
}, },
"com.unity.timeline": { "com.unity.timeline": {
"version": "1.5.6", "version": "1.6.1",
"depth": 0, "depth": 0,
"source": "registry", "source": "registry",
"dependencies": { "dependencies": {
......
This diff is collapsed.
m_EditorVersion: 2021.1.18f1 m_EditorVersion: 2021.2.0b9
m_EditorVersionWithRevision: 2021.1.18f1 (25bdc3efbc2d) m_EditorVersionWithRevision: 2021.2.0b9 (162b5e238388)
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