private void Raycast()
    {
        Ray        ray = new Ray(playerHead.position, playerHead.forward * rayLength);
        RaycastHit hit;

        Debug.DrawRay(playerHead.position, playerHead.forward);
        if (Physics.Raycast(ray, out hit))
        {
            if (hit.collider.gameObject.CompareTag("Target") && shootTimer >= weapon.fireRate)
            {
                MakeShot(hit.collider.GetComponent <Rigidbody>(), hit);
                return;
            }
            if (hit.collider.gameObject.CompareTag("WalkingTarget") && shootTimer >= weapon.fireRate)
            {
                MakeWalkingShot(hit.collider.gameObject, hit);
                return;
            }
            if (hit.collider.gameObject.CompareTag("VR_UI"))
            {
                imgProgressBar          = hit.collider.gameObject.GetComponent <ImageProgressBar>();
                imgProgressBar.GazeOver = true;
                imgProgressBar.StartFillingProgressBar();
                return;
            }
            else if (imgProgressBar != null)
            {
                imgProgressBar.GazeOver = false;
                imgProgressBar.StopFillingProgressBar();
                imgProgressBar = null;
                return;
            }
        }
    }
Beispiel #2
0
        public override ExecutionResult Run(IStepExecutionContext context)
        {
            Guard.Against.Null(MaxTicks, nameof(MaxTicks));
            Guard.Against.Null(ProgressBar, nameof(ProgressBar));

            var options = ProgressBarFactory.DefaultOptions();

            options.ForegroundColor = ConsoleColor.Blue;

            ImageProgressBar ??= ProgressBar.Spawn(MaxTicks, null, options);

            ImageProgressBar.Tick(0);
            ImageProgressBar.MaxTicks = MaxTicks;

            return(ExecutionResult.Next());
        }