private void OnTriggerEnter2D(Collider2D collision) { if (collider.IsTouchingLayers(LayerMask.GetMask("Player")) && !playerRewind.timeIsRewinding && !playerRewind.playerIsInvicible) { Instantiate(spikeParticle, transform.position, Quaternion.identity); playerHealth.DamagePlayer(damage); soundManager.PlayClip(soundManager.ouchClip, 0.55f); playerRewind.StartRewind(); } }
private void HandleShowResult(ShowResult result) { PopUpManager.Instance.DisablePopUp("P_Ads"); switch (result) { case ShowResult.Finished: Rewind.StartRewind(); Debug.Log("Finished"); break; case ShowResult.Skipped: Rewind.StartRewind(); Debug.Log("Skipped"); break; case ShowResult.Failed: Debug.Log("Failed"); break; } }
private void ManageRaycast() { float rayLength = 0.53f; rightCenter = transform.position; for (int i = -1; i < 2; i++) { Vector2 rayOrigin = rightCenter + Vector2.up * i * 0.2f; RaycastHit2D hit = Physics2D.Raycast(rayOrigin, Vector2.right, rayLength, collisionMask); Debug.DrawLine(rayOrigin, rayOrigin + Vector2.right * rayLength, Color.red); if (hit && !playerRewind.timeIsRewinding && !playerRewind.playerIsInvicible) { soundManager.PlayClip(soundManager.bangClip, 1.6f); playerHealth.DamagePlayer(damage); playerRewind.StartRewind(); } } }