public static void Medium(bool isVibration = true) { if (isVibration) { Taptic.Medium(); //Debug.Log("Vibro: Medium"); } }
private IEnumerator Flip() { CollectionManager.Instance.flip(); _currentRot = Player.Instance.transform.eulerAngles.z; canFlip = false; GameManager.Instance.combo += 1; Taptic.Medium(); yield return(new WaitForSeconds(0.1f)); _afterRot = Player.Instance.transform.eulerAngles.z; result = _currentRot - _afterRot; if (result <= 30) { canFlip = false; } else { canFlip = true; } }
public void TriggerTaptic(string type) { if (type == "warning") { Taptic.Warning(); } else if (type == "failure") { Taptic.Failure(); } else if (type == "success") { Taptic.Success(); } else if (type == "light") { Taptic.Light(); } else if (type == "medium") { Taptic.Medium(); } else if (type == "heavy") { Taptic.Heavy(); } else if (type == "default") { Taptic.Default(); } else if (type == "vibrate") { Taptic.Vibrate(); } else if (type == "selection") { Taptic.Selection(); } }
void OnTriggerEnter(Collider other) { if (this.gameObject == top.topCart && other.gameObject.tag == "stack" && stackFlag == 0) { other.gameObject.transform.parent.gameObject.GetComponent <stack>().stacked = 1; Taptic.Medium(); speedPS.SetActive(true); //other.gameObject.transform.parent.gameObject.GetComponent<movement>().enabled = true; foreach (BoxCollider col in GetComponents <BoxCollider>()) { // if(col.isTrigger == false) // col.enabled = false; } foreach (BoxCollider col in other.gameObject.transform.parent.gameObject.GetComponents <BoxCollider>()) { // if(col.isTrigger == false) // col.enabled = true; } stackFlag = 1; top.cartNumber++; top.topCart = other.gameObject.transform.parent.gameObject; displacement = top.displacement; top.displacement += 0.95f; frontCart = other.gameObject.transform.parent.gameObject; top.topCart.transform.GetChild(1).GetComponent <BoxCollider>().enabled = false; splashInstance = Instantiate(splash, this.transform.position + splashOffset, Quaternion.identity); splashInstance.transform.SetParent(this.gameObject.transform, true); followCam.fov += 1.5f; followCam.temp.x += 0.7f; followCam.offset += new Vector3(0f, 0.2f, 0.2f); } if (other.gameObject.tag == "Finish") { mov.finishFlag = 1; } }
public static void Vibrate(VibrationType vibrationType) { switch (vibrationType) { case VibrationType.Light: if (PlayerDataController.data.isVibrationOpen) { Taptic.Light(); } break; case VibrationType.Medium: if (PlayerDataController.data.isVibrationOpen) { Taptic.Medium(); } break; case VibrationType.Success: if (PlayerDataController.data.isVibrationOpen) { Taptic.Success(); } break; case VibrationType.Failure: if (PlayerDataController.data.isVibrationOpen) { Taptic.Failure(); } break; default: break; } }
// Update is called once per frame void Update() { if (SceneManager.GetActiveScene().buildIndex < 6) { if (attackFlag == 0 && checkScript.remainCount != 0) { unit.transform.Translate(0f, 0f, unitForwardSpeed * Time.timeScale * Time.deltaTime); } } else if (SceneManager.GetActiveScene().buildIndex >= 6) { if (attackFlag == 0 && DeadCheck.remainCount != 0) { unit.transform.Translate(0f, 0f, unitForwardSpeed * Time.timeScale * Time.deltaTime); } } if (attackFlag == 1) { enemiesRemaining = enemies.Count; playersRemaining = players.Count; for (int i = 0; i < enemies.Count; i++) { if (enemies[i].activeInHierarchy == false) { if (enemiesDeathFlag[i] == 0) { Instantiate(DeathRed, enemies[i].transform.position + new Vector3(0f, 0.4f, 0f), Quaternion.identity); Taptic.Medium(); enemiesDeathFlag[i] = 1; } enemiesRemaining -= 1; } } for (int i = 0; i < players.Count; i++) { if (players[i].activeInHierarchy == false) { if (playersDeathFlag[i] == 0) { Instantiate(DeathBlue, players[i].transform.position + new Vector3(0f, 0.4f, 0f), Quaternion.identity); Taptic.Medium(); playersDeathFlag[i] = 1; } playersRemaining -= 1; } } } //GAME OVER if (gameOver == 1) { foreach (GameObject player in players) { player.GetComponent <Animator>().SetBool("isRunning", false); player.GetComponent <Animator>().SetBool("isHitting", false); // player.GetComponent<Individual>().trail.SetActive(false); } foreach (GameObject enemy in enemies) { enemy.GetComponent <Animator>().SetBool("isRunning", false); enemy.GetComponent <Animator>().SetBool("isHitting", false); // enemy.GetComponent<IndividualEnemy>().trail.SetActive(false); } if (playersRemaining == 0 && endFlag == 0) { gameOverDisplay.SetActive(true); Debug.Log("Level " + "Failed , " + PlayerPrefs.GetInt("LevelNumber")); //Time.timeScale = 0.6f; endFlag = 1; } else if (enemiesRemaining == 0 && endFlag == 0) { levelCompleteDisplay.SetActive(true); Debug.Log("Level " + "Complete , " + PlayerPrefs.GetInt("LevelNumber")); //Time.timeScale = 0.6f; endFlag = 1; } } }