void Update() { if (blockState.GetState() == 1) { gameObject.SetActive(false); } else if (blockState.GetState() == 3) { gameObject.SetActive(true); } }
void Update() { if (parent.GetState() == 1 && parent.GetisStop() == true && character.IsGameStarted()) { if (Input.GetKey(KeyCode.Space) || (Input.touchCount > 0 && (Input.GetTouch(0).phase != TouchPhase.Ended))) { if (state == 0) { if (PlayerPrefs.GetInt("sound", 0) == 1) { m_audio.Play(); } line = Instantiate(linePrefab, transform.position, transform.rotation).gameObject; state = 1; } else if (state == 1 && line.transform.localScale.y < 400) { line.transform.localScale += new Vector3(0, SPEED_OF_LINE, 0) * Time.deltaTime; } } else if (state == 1) { if (PlayerPrefs.GetInt("sound", 0) == 1) { m_audio.Pause(); } state = 2; } if (state == 2) { RotateAnimationStart(); if (line.transform.rotation == Quaternion.Euler(0, 0, ROTATE_ANGLE)) { character.SetNormalSpeed(); state = 3; } } } if (!line) { state = 0; } }