public void Smashing() { if (!IsSmashStarted) { IsSmashStarted = true; return; } if (OnController() == ControlStatus.Smash) { manager.AllSmashing(controller.TouchPoint); se.SeChanger(2); se.Play(); SmashCount = 0; ImageChanged(); fallStopper.SetActive(true); IsSmashStarted = false; } }
private void Moving() { SetSpeed(); //落下したら if (wallHitter.IsHit(gameObject, HitPointFlag.Bottom)) { FallOut(); } if (wallHitter.IsHit(gameObject, HitPointFlag.Left | HitPointFlag.Right | HitPointFlag.Top)) { se.Play(); } }
private void BallSet(bool isStarted = false) { if (!isStarted) { if (gameManager.GameState == GameManager.GameStatus.GameOver || gameManager.RequestGameState == GameManager.GameStatus.GameOver) { return; } se.Play(); bool flag = gameManager.LostLife(); //ライフを減らす処理 if (flag) { return; } gameManager.RequestGameState = GameManager.GameStatus.Wait; bar.ResetScale(); //バーのサイズをリセット goddess.transform.position = new Vector2(0, goddess.transform.position.y); goddess.IsStoped = true; } Instantiate(ballPrefab, goddess.FirstPosition, Quaternion.identity); }
private void Moving() { //EndTime秒間画面をスクロールする timer += Time.deltaTime; Scroll(); if (timer > moveEndTime) { timer = 0.0f; if (enemyManager.LastEnemies()) { ScrollCanvas.SetActive(true); se.Play(); state = Status.Warning; } else { state = Status.Stopping; manager.RequestGameState = GameManager.GameStatus.Wait; } } }
// Update is called once per frame void Update() { #if UNITY_EDITOR //タップに関する何か if (Input.GetMouseButtonDown(0)) { if (!BackGroundIsTaped(backGoround)) { return; } State = Status.Pushed; TouchMovePoint = TouchPoint = mainCamera.ScreenToWorldPoint(Input.mousePosition); se.Play(); } else if (Input.GetMouseButtonUp(0)) { State = Status.Released; } else if (Input.GetMouseButton(0)) { if (TouchMovePoint != (Vector2)Input.mousePosition) { if (!BackGroundIsTaped(backGoround)) { return; } State = Status.PressingMove; TouchMovePoint = mainCamera.ScreenToWorldPoint(Input.mousePosition); } else { State = Status.Pressing; } } else { State = Status.Free; } #elif UNITY_ANDROID || UNITY_IPHONE if (Input.touchCount > 0) { //タップに関する何か if (Input.touches[0].phase == TouchPhase.Began) { if (!BackGroundIsTaped(backGoround)) { return; } State = Status.Pushed; TouchMovePoint = TouchPoint = mainCamera.ScreenToWorldPoint(Input.touches[0].position); se.Play(); } else if (Input.touches[0].phase == TouchPhase.Moved) { if (!BackGroundIsTaped(backGoround)) { return; } State = Status.PressingMove; TouchMovePoint = mainCamera.ScreenToWorldPoint(Input.touches[0].position); } else if (Input.touches[0].phase == TouchPhase.Stationary) { State = Status.Pressing; } else if (Input.touches[0].phase == TouchPhase.Ended) { State = Status.Released; } } else { State = Status.Free; } #endif }
public void OnClick() { tap.Play(); manager.NextLevelSelect(); }
public void Select(int level) { GameManager.SelectLevel = level; tap.Play(); SceneManager.LoadScene("Stage1"); }
// Use this for initialization void Start() { se.Play(); }