/** * Update is called once per frame */ void Update() { // counter更新 if (canCount && playSeconds >= 0f) { playSeconds -= Time.deltaTime; if (playSeconds < 1f) { playSeconds = 0f; gameDirector.Action(GameActionEvent.EventType.ChaserModeCountEnd); canCount = false; StartCoroutine(GameEnd()); } UpdateCounter((int)playSeconds); } // 着席モードでRキーで位置トラッキングをリセットする if (Input.GetKeyDown(KeyCode.R)) { SteamVR.instance.hmd.ResetSeatedZeroPose(); } // デバッグ用 マウス操作 var mousePos = Input.mousePosition; mousePos.z = 0.1f; var point = Camera.main.ScreenToWorldPoint(mousePos); gameDirector.HoverScreen(Player.ColorType.Pink, point); if (Input.GetMouseButtonDown(0)) { gameDirector.ShotScreen(Player.ColorType.Pink, point); Ray ray = Camera.main.ScreenPointToRay(Camera.main.WorldToScreenPoint(point)); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit)) { InkSplashShaderBehavior script = hit.collider.gameObject.GetComponent <InkSplashShaderBehavior>(); if (null != script && canCount) { var colorType = Player.ColorType.Pink; var index = (int)colorType; script.PaintOn(hit.textureCoord, SplashImages[index]); string hitTag = hit.collider.tag; gameDirector.AddScore(colorType); int score = gameDirector.GetScore(colorType); Scores[index].text = String.Format("{0}", score); } } } }
/** * Update is called once per frame */ void Update() { if (Input.GetKeyDown(KeyCode.E)) { gameDirector.GameEnd(); gameDirector.Action(GameActionEvent.EventType.GameEnd); } }
/** * モンスター発見 */ private IEnumerator ShowFindMessage() { // 開始テキスト非表示 if (startText.gameObject.activeSelf) { startText.gameObject.SetActive(false); } if (nextText.gameObject.activeSelf) { yield break; } // BGMストップ AudioSource audioSource = GetComponent <AudioSource>(); audioSource.Stop(); yield return(new WaitForSeconds(0.5f)); // 発見音再生 audioSource.PlayOneShot(SE_BossFindAll); yield return(new WaitForSeconds(2.0f)); // テキスト表示 nextText.gameObject.SetActive(true); yield return(new WaitForSeconds(2f)); // メイン照明ON Background.gameObject.SetActive(false); yield return(new WaitForSeconds(0.5f)); foreach (GameObject target in TargetObject) { if (target.activeSelf) { SpScene2 hitscript = target.GetComponentInParent <SpScene2>(); if (hitscript != null) { hitscript.HeadUp(); } } } yield return(new WaitForSeconds(2f)); // 遷移 gameDirector.Action(GameActionEvent.EventType.SearchModeSceneEnd); yield break; }
// Update is called once per frame void Update() { // エントリー表示中なら if (Timer.gameObject.activeSelf && startCount >= 0f) { // カウントダウン startCount -= Time.deltaTime; if (startCount < 0f) { // 0 なったらシーン移動 startCount = 0f; gameDirector.Action(GameActionEvent.EventType.TitleSceneEnd); } Timer.text = String.Format("{0}", (int)(startCount)); } // デバッグ用 マウス操作 var mousePos = Input.mousePosition; mousePos.z = 0.1f; var point = Camera.main.ScreenToWorldPoint(mousePos); gameDirector.HoverScreen(Player.ColorType.Pink, point); if (Input.GetKeyDown(KeyCode.Space)) { gameDirector.ShotScreen(Player.ColorType.Pink, point); } if (Input.GetMouseButtonDown(0)) { float distance = 100; // 飛ばす&表示するRayの長さ float duration = 3; // 表示期間(秒) Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Debug.DrawRay(ray.origin, ray.direction * distance, Color.red, duration, false); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, distance)) { GameObject hitObject = hit.collider.gameObject; // (以下略) } } }