|
|
|
|
@ -27,7 +27,7 @@ namespace UltraCombos.Minions.GirlsRoom.Nav |
|
|
|
|
public TextureEvent onPrint = new TextureEvent(); |
|
|
|
|
|
|
|
|
|
[System.Serializable] |
|
|
|
|
public class LuggageEvent : UnityEvent<string, Texture2D, Texture2D> { } |
|
|
|
|
public class LuggageEvent : UnityEvent<string, Texture2D, Texture2D, Color32> { } |
|
|
|
|
public LuggageEvent onPrintLuggage = new LuggageEvent(); |
|
|
|
|
|
|
|
|
|
private void Start() |
|
|
|
|
@ -66,7 +66,18 @@ namespace UltraCombos.Minions.GirlsRoom.Nav |
|
|
|
|
|
|
|
|
|
if (painting_texture && signature_texture) |
|
|
|
|
{ |
|
|
|
|
painting.UpdateArtwork(work.serial, painting_texture, signature_texture); |
|
|
|
|
Color32 color; |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
string message = File.ReadAllText(work.message_path); |
|
|
|
|
color = Frozen.RoyalGallery.Utils.HexToColor(message); |
|
|
|
|
} |
|
|
|
|
catch (FileNotFoundException e) |
|
|
|
|
{ |
|
|
|
|
color = new Color32(255, 255, 255, 255); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
painting.UpdateArtwork(work.serial, painting_texture, signature_texture, color); |
|
|
|
|
|
|
|
|
|
yield return new WaitForEndOfFrame(); |
|
|
|
|
|
|
|
|
|
@ -78,7 +89,7 @@ namespace UltraCombos.Minions.GirlsRoom.Nav |
|
|
|
|
|
|
|
|
|
// should be replaced with printing process |
|
|
|
|
onPrint.Invoke(printing_texture); |
|
|
|
|
onPrintLuggage.Invoke(work.serial, painting_texture, signature_texture); |
|
|
|
|
onPrintLuggage.Invoke(work.serial, painting_texture, signature_texture, color); |
|
|
|
|
/* |
|
|
|
|
string path = $"../../Build_GirlsRoomNav/Print/{work.serial}.jpg"; |
|
|
|
|
System.IO.File.WriteAllBytes(path, printing_texture.EncodeToJPG()); |
|
|
|
|
@ -89,11 +100,11 @@ namespace UltraCombos.Minions.GirlsRoom.Nav |
|
|
|
|
coroutine = null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void PrintLuggage(string serial, Texture2D painting, Texture2D signature) |
|
|
|
|
public void PrintLuggage(string serial, Texture2D painting, Texture2D signature, Color32 color) |
|
|
|
|
{ |
|
|
|
|
if (luggage_coroutine == null) |
|
|
|
|
{ |
|
|
|
|
luggage_coroutine = StartCoroutine(PrintingLuggage(serial, painting, signature)); |
|
|
|
|
luggage_coroutine = StartCoroutine(PrintingLuggage(serial, painting, signature, color)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -101,13 +112,13 @@ namespace UltraCombos.Minions.GirlsRoom.Nav |
|
|
|
|
{ |
|
|
|
|
if (luggage_coroutine == null) |
|
|
|
|
{ |
|
|
|
|
luggage_coroutine = StartCoroutine(PrintingLuggage(work.serial, work.painting, work.signature)); |
|
|
|
|
luggage_coroutine = StartCoroutine(PrintingLuggage(work.serial, work.painting, work.signature, work.color)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
IEnumerator PrintingLuggage(string serial, Texture2D painting_texture, Texture2D signature_texture) |
|
|
|
|
IEnumerator PrintingLuggage(string serial, Texture2D painting_texture, Texture2D signature_texture, Color32 color) |
|
|
|
|
{ |
|
|
|
|
painting.UpdateArtwork(serial, painting_texture, signature_texture); |
|
|
|
|
painting.UpdateArtwork(serial, painting_texture, signature_texture, color); |
|
|
|
|
|
|
|
|
|
yield return new WaitForEndOfFrame(); |
|
|
|
|
|
|
|
|
|
|