public void Update() { if (!onAlert) { onAlert = playerEuphoriaController.IsEuphoric(); } }
// Update is called once per frame public void Update() { if (euphoriaC.IsEuphoric() == false) { if (playerTransform.rotation.eulerAngles.z >= 225 && playerTransform.rotation.eulerAngles.z <= 315) { spriteR.sprite = sprites[0]; } else if (playerTransform.rotation.eulerAngles.z < 225 && playerTransform.rotation.eulerAngles.z >= 135) { spriteR.sprite = sprites[2]; } else if (playerTransform.rotation.eulerAngles.z < 135 && playerTransform.rotation.eulerAngles.z >= 45) { spriteR.sprite = sprites[3]; } else { spriteR.sprite = sprites[1]; } } else if (playerTransform.rotation.eulerAngles.z > 180) { spriteR.sprite = sprites[4]; } else { spriteR.sprite = sprites[5]; } }
public void Update() { if (euphoriaController.IsEuphoric()) { if (audios[NORMAL].isPlaying) { audios[NORMAL].Stop(); } if (!audios[EUPHORIA].isPlaying) { audios[EUPHORIA].Play(); } } else { if (audios[EUPHORIA].isPlaying) { audios[EUPHORIA].Stop(); } if (!audios[NORMAL].isPlaying) { audios[NORMAL].Play(); } } }
public void Update() { if (!onAlert) { onAlert = eyeController.PlayerInSight() && (playerEuphoriaController.IsEuphoric() || meleeHitController.IsAttacking()); } }
public void Update() { if (euphoriaController.IsDead()) { return; } Vector2 movement = new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")); if (euphoriaController.IsEuphoric()) { this.rigidBody.velocity = movement.normalized * this.euphoricSpeed; } else { this.rigidBody.velocity = movement.normalized * this.walkSpeed; } mousePos = Input.mousePosition - Camera.main.WorldToScreenPoint(transform.position); float angle = Mathf.Atan2(mousePos.y, mousePos.x) * Mathf.Rad2Deg; transform.rotation = Quaternion.AngleAxis(angle, Vector3.forward); }
public void OnTriggerStay2D(Collider2D other) { if (!attacking) { return; } if (other.tag == "Cop") { if (euphoriaController.IsEuphoric()) { Object.Destroy(other.gameObject); euphoriaController.IncrementEuphoria(40); scoreController.IncrementScore(Mathf.Round(10f + 0.4f * euphoriaController.getEuphoriaValue())); } } else if (other.tag == "Civilian") { Object.Destroy(other.gameObject); euphoriaController.IncrementEuphoria(20); scoreController.IncrementScore(Mathf.Round(5f + 0.2f * euphoriaController.getEuphoriaValue())); } }