Skip to content

Commit 67d0b9d

Browse files
committed
test scroll
1 parent 0f00d5f commit 67d0b9d

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

Assets/Scenes/QR Generator.unity

+2-2
Original file line numberDiff line numberDiff line change
@@ -5641,7 +5641,7 @@ MonoBehaviour:
56415641
m_HorizontalOverflow: 0
56425642
m_VerticalOverflow: 0
56435643
m_LineSpacing: 1
5644-
m_Text: Result
5644+
m_Text:
56455645
--- !u!222 &1188234761
56465646
CanvasRenderer:
56475647
m_ObjectHideFlags: 0
@@ -8189,7 +8189,7 @@ MonoBehaviour:
81898189
m_HorizontalOverflow: 0
81908190
m_VerticalOverflow: 0
81918191
m_LineSpacing: 1
8192-
m_Text: Camera
8192+
m_Text: Turn on Camera
81938193
--- !u!222 &1497582429
81948194
CanvasRenderer:
81958195
m_ObjectHideFlags: 0

Assets/Scripts/Generator.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ public void StartGenerate()
192192

193193
IEnumerator Co_GenerateSingle()
194194
{
195-
Debug.Log("start generate");
196-
yield return null;
197195
isProcessing = true;
198196
onGenerate = true;
199197

198+
yield return null;
199+
200200
int maxContent = 1;
201201
int currentIndex = 0;
202202

@@ -213,9 +213,10 @@ IEnumerator Co_GenerateSingle()
213213

214214
currentFileNameText.text = string.Format("File name: {0}", currentFileName);
215215

216-
qrCodeEncodeController.Encode(singleMode.text);
216+
int code = qrCodeEncodeController.Encode(singleMode.text);
217217
yield return new WaitUntil(() => onGenerate == false);
218-
218+
Debug.Log(code);
219+
219220
currentIndex++;
220221
progressText.text = string.Format("{0}/{1}", currentIndex, maxContent);
221222
progressBarImage.fillAmount = (float)currentIndex / (float)maxContent;

Assets/Scripts/Scanner.cs

+9-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ IEnumerator Initialize()
7979

8080
private void OnQRScaned(string msg)
8181
{
82-
DisplayResult(msg);
82+
StartCoroutine(_DisplayResult(msg));
8383

8484
if (autoResetToggle.isOn)
8585
{
@@ -207,12 +207,18 @@ private void ReadFile(string path)
207207
private void TextureDecode(Texture2D texture)
208208
{
209209
string msg = QRCodeDecodeController.DecodeByStaticPic(texture);
210-
DisplayResult(msg);
210+
StartCoroutine(_DisplayResult(msg));
211211
}
212212

213-
private void DisplayResult(string msg)
213+
214+
IEnumerator _DisplayResult(string msg)
214215
{
216+
resultText.gameObject.SetActive(false);
215217
resultText.text = string.Format("{0}", msg);
218+
219+
yield return null;
220+
221+
resultText.gameObject.SetActive(true);
216222
resetButton.gameObject.SetActive(true);
217223
}
218224
}

0 commit comments

Comments
 (0)