void Awake() { instance = this; scoreKeeper = GetComponent <Score>(); slowMotion = GetComponent <SlowMotion>(); bulletManager = GetComponent <BulletManager>(); }
void Awake() { share = this; _cachedTrans = transform; _mode = "Sometimes"; _cachedTrans.position = Vector3.zero; }
private void DeathEffect() { SlowMotion.SlowTime(deathSlowdown, slowFadeIn, slowFadeOut); CameraHandler.ScreenShake(0.7f, 0.3f, 1f); if (deathEffect == null) { return; } var effect = Instantiate(deathEffect, transform.position, transform.rotation); effect.transform.parent = null; Destroy(effect, deathEffectLifetime); if (trail != null) { trail.transform.parent = null; trail.Stop(); Destroy(trail, 10f); } if (isGameOverOnDeath) { LevelHandler.Instance.GameOver(); } }
void Start() { _screenShake = Camera.main.GetComponent <ScreenShake>(); _knockback = transform.root.GetComponent <Knockback>(); _muzzleFlash = GetComponent <ParticleSystem>(); _slowMotion = transform.root.GetComponent <SlowMotion>(); }
private void OnCollisionEnter(Collision other) { if (other.collider.CompareTag("Floor") && _slowMotionEffect) { SlowMotion.StartSlowMotion(); } }
private void InitializeSlowMotionEffect() { playerSlowMotion = player.GetComponent <SlowMotion>(); playerSlowMotion.OnSlowMotionActivated += ShowSlowMotion; playerSlowMotion.OnSlowMotionDeActivated += HideSlowMotion; }
public void ResetEnemy() { SlowMotion.DisableSlowMotion(); transform.position = _startPosition; SetRagdollCollidersState(false); SetRigidbodiesState(true); _animator.enabled = true; }
private void OnTriggerEnter(Collider other) { if (other.gameObject.layer == LayerMask.NameToLayer("Player")) { gameObject.SetActive(false); // Prevent double activation SlowMotion.StartSlowMotion(); player.ActivateLaser(); } }
// Use this for initialization void Start() { _mainCamera = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera> (); _slowMotion = _mainCamera.GetComponent <SlowMotion> (); _rigidbody = GetComponent <Rigidbody> (); CrossHairRenderer.gameObject.SetActive(true); CrossHairRenderer.startWidth = 0; }
void Start() { animator = GetComponent <Animator>(); audioSource = GetComponent <AudioSource>(); characterMovement = GetComponent <Character>(); slowMotion = Camera.main.GetComponent <SlowMotion>(); currentHealthPoints = maximumHealthPoints; }
public static void enemyKilled() { numberOfEnemies--; if (numberOfEnemies == 0) { playerManager.DisableLaser(); SlowMotion.StopSlowMotion(); playerManager.Reload(); } }
private void OnCollisionEnter(Collision collision) { Debug.Log("PlayerKilled"); if (collision.gameObject.layer == LayerMask.NameToLayer("Player")) { SlowMotion.StopSlowMotion(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } //Destroy(gameObject); }
private void PlayerRolled(CharacterController charController) { gameObject.layer = INV_LAYER; invTimer = invTime; dodgeTimer = dodgeCooldown; SlowMotion.SlowTime(0.3f, 0.2f, 0.6f); animator.SetTrigger("Dodge"); dodgeEffect.Play(); dodgeSound.pitch = Random.Range(0.9f, 1.1f); dodgeSound.Play(); }
private void Awake() { animation = GetComponentInChildren <AnimationManager>(); slowMotion = GetComponent <SlowMotion>(); Dead = false; if (isPlayer) { movement = GetComponent <MovementManager>(); uiManager = GetComponent <UIManager>(); } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.layer == LayerMask.NameToLayer("Enemy")) { Level.enemyKilled(); collision.gameObject.SetActive(false); } Destroy(gameObject); if (collision.gameObject.layer == LayerMask.NameToLayer("Hostage")) { SlowMotion.StopSlowMotion(); SceneManager.LoadScene(SceneManager.GetActiveScene().name); } }
public void changeHealth(int value) { int prevCurrentHealth = CurrentHealth; if (value == 0) { return; } if (value < 0 && (IsInvincible || IsEtherial)) { //print("Casper is invincible"); return; } CurrentHealth += value; if (CurrentHealth > MaxHealth) { CurrentHealth = MaxHealth; } if (CurrentHealth < 0) { CurrentHealth = 0; } if (CurrentHealth == 1) { StartCoroutine(SlowMotion.DoSlowMotion(5, 0.05f)); } if (CurrentHealth <= 0) { StartCoroutine(SlowMotion.DoSlowMotion(2, 0.05f)); StartCoroutine(Die()); } onHealthChange?.Invoke(CurrentHealth); if (CurrentHealth > prevCurrentHealth) { CasperHealedEvent?.Invoke(); } else if (CurrentHealth < prevCurrentHealth) { float invTimer = 2f; StartCoroutine(ToggleInvincibility(invTimer)); StartCoroutine(FlashCasper(invTimer)); Camera.main.GetComponent <CameraShake>().ShakeCamera(4f, 4f); CasperDamageEvent?.Invoke(); } }
// Creates an Event with the same properties as the given event public Event(Event other) { type = other.type; actionToPerform = other.actionToPerform; basicActionToPerform = other.basicActionToPerform; soundEffect = other.soundEffect; cameraMovement = new CameraMovement(other.cameraMovement); slowMotion = other.slowMotion; particleEvent = other.particleEvent; forceEvent = new Force(other.forceEvent, false); colorFlash = other.colorFlash; ghostEffect = other.ghostEffect; screenShake = other.screenShake; tweenEvent = other.tweenEvent; startTime = other.startTime; duration = other.duration; }
void OnCollisionEnter(Collision collision) { GameObject target = collision.gameObject; HealthSystem healthSystem = target.GetComponent <HealthSystem>(); SlowMotion slowMotion = Camera.main.GetComponent <SlowMotion>(); if (healthSystem) { healthSystem.TakeDamage(damageToDeal); slowMotion.SlowTime(); ParticleUtility.PlayParticleEffect( target.transform, particleEffectPrefab, target.transform.position, ParticleUtility.PARTICLE_STD_Y_OFFSET ); } Destroy(gameObject); }
void Start() { gun = GetComponentInChildren <Gun>(); slowMotion = GetComponentInChildren <SlowMotion>(); }
private void Awake() { instance = this; }
void Awake() { Instance = this; }
// Start is called before the first frame update void Start() { SlowMotionButton.action.performed += HandleSlowMotionButtonPress; slowMotionScript = gameManager.GetComponent<SlowMotion>(); }