// Stops scanning the video feed public void EndScanning() { if (currentState == CurrentScanState.Scanning) { currentState = CurrentScanState.Idle; StopCoroutine(Scanning()); StartCoroutine(ShrinkIcon(0.3f)); //infoText.text = "Nothing found"; } }
public void ScanSuccess(string result) { infoText.text = result; currentState = CurrentScanState.ResultFound; scanButton.GetComponent <Image>().sprite = resumeSprite; /*********************************************************/ //Packet p = new Packet((int)PacketType.QRCODE, result); //p.generalData.Add(result); //Client.SendPacket(p, LibProtocolType.UDP); /*********************************************************/ PauseCameraFeed(); }
// Starts the coroutine that scans the video feed public void StartScanning() { // If we a result has been found then don't immediately go back to scanning. if (currentState == CurrentScanState.ResultFound) { scanButton.GetComponent <Image>().sprite = scanSprite; currentState = CurrentScanState.Idle; ResumeCameraFeed(); return; } currentState = CurrentScanState.Scanning; StartCoroutine(Scanning()); if (!iconZooming) { StartCoroutine(EnlargeIcon(1.1f, 0.3f)); } StartCoroutine(RotateIcon(0.3f)); infoText.text = ""; }
private void Scan() { this.currentScan = new CurrentScanState(); if (requestReset) { this.Reset(); } // Scan these before game-modes, to catch victories earlier if (!this.gameJustEnded && !pauseScanning) { // Scan victory earlier if (this.inGameCounter >= 2) { this.ScanVictory(); } if (this.inGameCounter >= 1) { this.ScanHeroes(); } if (this.inGameCounter >= 1) { this.ScanCoin(); } if (this.inGameCounter >= 1) { this.ScanTurn(); // TODO: enable again sometimee later // this.ScanConceded(); } } this.ScanGameModes(); if (gameMode == GameMode.Unknown) { ScanDeckScreenshot(); } if (gameMode == GameMode.Arena) { ScanArenaDeckScreenshot(); } // Make sure this is AFTER ScanGameModes() !! if (this.pauseScanning) { return; } if (this.currentScan.ArenaLeafDetected && this.inGameCounter <= 0) { if (!Detect(this.areas, "arenanohero")) { this.ScanArenaHero(); if (this.arenaHero != null) { this.ScanArenaScore(); } } if (this.arenaHero == null) { this.ScanArenaDrafting(); } } }