void Update() { if (Input.GetKeyDown(KeyCode.Return)) { cameraShake.LittleShake(); } if (Input.GetKeyDown(KeyCode.Space)) { cameraShake.BigShake(); } }
void CheckForAsteroids() { RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.right, 100, enemyLayer); if (hit) { cameraShake.BigShake(); Destroy(hit.transform.gameObject); state.amounts["worldHealth"]--; } }
public IEnumerator TriggerFX() { yield return(new WaitForSeconds(attacks[i].triggerImpactFXDelay)); GameObject g = Instantiate(attacks[i].HitFX, transformFX); g.GetComponent <DestroyFX>().destroyFX = true; if (moveDirection == false) { g.transform.position = attacks[i].ImpactPositionRight.transform.position; } if (moveDirection == true) { g.transform.position = attacks[i].ImpactPositionLeft.transform.position; } StartCoroutine(cameraS.BigShake()); }
void Update() { if (Input.GetKeyDown(KeyCode.Return)) { CameraShake.LittleShake(); } else if (Input.GetKeyDown(KeyCode.Space)) { CameraShake.BigShake(); } else { // CameraShake adds to the current pose of the camera. // Therefore, we have to maintain its "base pose" for the example. _cameraTransform.position = _basePosition; _cameraTransform.rotation = _baseRotation; } }
IEnumerator QuickPause() { state.TogglePause(true); yield return(new WaitForSeconds(0.035f)); state.TogglePause(false); moveObeject.PushBack(); if (health <= 0) { Destroy(); cameraShake.BigShake(); } else { cameraShake.SmallShake(); animator.Play("hit"); } }