public void Restart() { BulletLines.SetActive(Settings.DrawLines); Clear(); States[CurrentState].Restart(); }
public override void Restart() { base.Restart(); RespawnWoman(); Randomizer(); BulletLines.SetActive(Exercise.Settings.DrawLines); }
private void OnSettingsChanged() { BulletLines.SetActive(Settings.DrawLines); ApplyGunRotation[] guns = GameObject.Find("[CameraRig]").GetComponentsInChildren <ApplyGunRotation>(); foreach (ApplyGunRotation gun in guns) { gun.Apply(); } }
public void OnProgressChanged() { Exercise.whiteboard.CheckProgress(); if (Exercise.Progress == ExerciseProgress.Succeeded || Exercise.Progress == ExerciseProgress.Failed) { BulletLines.ForceActive(); OnFinish(); } }
/// <summary> /// Checks the collison with the bullet ray and handles them /// </summary> private void DetectHit() { bool hasHit = Physics.Raycast(barrelExit.transform.position, transform.rotation * Vector3.forward, out RaycastHit hit); if (hasHit) { if (!hit.collider.gameObject.GetComponent <Enemy>()) { SpawnBulletHole(hit); } IHitable target = hit.transform.GetComponentInParent <IHitable>(); if (target == null) { if (drawLines) { BulletLines.SpawnLine(BulletLine, barrelExit.transform.position, barrelExit.transform.position + transform.rotation * Vector3.forward * 10, Color.red); } return; } HitType type = target.OnHit(this, hit); if (drawLines) { Color linecolor = Color.red; switch (type) { case HitType.MISS: linecolor = Color.red; break; case HitType.RIGHT: linecolor = Color.green; break; case HitType.UNWANTED: linecolor = Color.magenta; break; } BulletLines.SpawnLine(BulletLine, barrelExit.transform.position, barrelExit.transform.position + transform.rotation * Vector3.forward * 10, linecolor); } } else { if (drawLines) { BulletLines.SpawnLine(BulletLine, barrelExit.transform.position, barrelExit.transform.position + transform.rotation * Vector3.forward * 10, Color.red); } } }
public void Start() { BulletLines.SetActive(Settings.DrawLines); Settings.SettingsChanged += OnSettingsChanged; foreach (ExcersiseState state in States) { state.gameObject.SetActive(false); } States[CurrentState].OnInitialize(); if (Settings.UseNormalGuns) { GameObject.Find("Toggle Controller").GetComponent <GazeButtonToggle>().Activate(); } }
public virtual void OnStart() { if (leftGun) { leftGun.Reload(); } if (rightGun) { rightGun.Reload(); } StartTime = Time.realtimeSinceStartup; BulletLines.SetActive(Exercise.Settings.DrawLines); Exercise.Progress = ExerciseProgress.Started; Exercise.StartButton.SetState(false); Exercise.RestartButton.SetState(true); }
/// <summary> /// Clears the exercise from bullet lines, bullet holes and scenario logs /// </summary> public void Clear() { ScenarioLogs.Clear(); BulletLines.Destroy(); DeleteBulletHoles(); }