Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        // Declare variables
        Player      playerScript      = FindObjectOfType <Player>();
        Respawn     respawnScript     = FindObjectOfType <Respawn>();
        LiveDisplay liveDisplayScript = FindObjectOfType <LiveDisplay>();

        if (playerScript != null)
        {
            if (playerScript.Live > 0)
            {
                playerScript.Live--;

                if (respawnScript != null)
                {
                    respawnScript.StartPosition();
                }

                if (liveDisplayScript != null)
                {
                    liveDisplayScript.SetHearts();
                }
            }
            else
            {
                SceneManager.LoadScene(3); // Load lose screen
            }
        }
    }
Пример #2
0
        private void ImageSource_OnImage(Object theImage)
        {
            if (watchOn != null)
            {
                watchOn.Abort();
            }

            if (Sr_status == SensorStatus.Aborting)
            {
                SmartRayImageSource.SoftTrigger();
                NotifierHelper.Notify("ImageSource.SoftTriger");
            }
            else

            {
                NotifierHelper.Notify("Sensor.OnImage", "获得图像。");

                object[] imgs = theImage as object[];

                this.LiveDisplay.Image = imgs[0] as ICogImage;
                LiveDisplay.Fit();

                visionProAlg.Inputs["ZMap"].Value      = imgs[0];
                visionProAlg.Inputs["Intensity"].Value = imgs[1];
                visionProAlg.Run();
                //this.VisionProject.VisionAlgorithm.Inputs["ZMap"] = imgs[0];
                //this.VisionProject.VisionAlgorithm.Inputs["Intensity"] = imgs[1];
                //this.VisionProject.VisionAlgorithm.Run();
            }

            Sr_status = SensorStatus.Idle;
        }
Пример #3
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        // Destroi quem colidiu e decrementa "vida"
        Destroy(other.gameObject);
        LiveDisplay liveDisplay = FindObjectOfType <LiveDisplay>();

        liveDisplay.TakeLife();
    }
    /// <summary>
    /// Sets the vertical overflow cropping strategy.
    /// </summary>
    /// <param name="live">The <see cref="LiveDisplay"/> instance.</param>
    /// <param name="cropping">The overflow cropping strategy to use.</param>
    /// <returns>The same instance so that multiple calls can be chained.</returns>
    public static LiveDisplay Cropping(this LiveDisplay live, VerticalOverflowCropping cropping)
    {
        if (live is null)
        {
            throw new ArgumentNullException(nameof(live));
        }

        live.Cropping = cropping;

        return(live);
    }
    /// <summary>
    /// Sets the vertical overflow strategy.
    /// </summary>
    /// <param name="live">The <see cref="LiveDisplay"/> instance.</param>
    /// <param name="overflow">The overflow strategy to use.</param>
    /// <returns>The same instance so that multiple calls can be chained.</returns>
    public static LiveDisplay Overflow(this LiveDisplay live, VerticalOverflow overflow)
    {
        if (live is null)
        {
            throw new ArgumentNullException(nameof(live));
        }

        live.Overflow = overflow;

        return(live);
    }
    /// <summary>
    /// Sets whether or not auto clear is enabled.
    /// If enabled, the live display will be cleared when done.
    /// </summary>
    /// <param name="live">The <see cref="LiveDisplay"/> instance.</param>
    /// <param name="enabled">Whether or not auto clear is enabled.</param>
    /// <returns>The same instance so that multiple calls can be chained.</returns>
    public static LiveDisplay AutoClear(this LiveDisplay live, bool enabled)
    {
        if (live is null)
        {
            throw new ArgumentNullException(nameof(live));
        }

        live.AutoClear = enabled;

        return(live);
    }
Пример #7
0
        private void SrIs_OnPackageImage(object theImage)
        {
            if (Sr_status == SensorStatus.Idle)
            {
                NotifierHelper.Notify("Sensor.StartScan", "启动扫描。");
                objScanState = ScanState.SCANNING;
                Sr_status    = SensorStatus.Scaning;
                lastScanTime = DateTime.Now;

                watchOn = new Thread(SensorWatchOn);
                watchOn.Start();
                //SR_timer.Interval = 8000;
                //SR_timer.Start();
            }
            this.LiveDisplay.Image = theImage as ICogImage;
            LiveDisplay.Fit();
        }