public void OnPlayerAction(int id) { switch (id) { case 1: StartCoroutine(OnRun()); break; default: var action = actions[id]; OnAction(action, player, monster); shakeManager.Shake(monsterRect, 0.5f, 1); break; } nextActionPlayer = false; }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.CompareTag("Enemy")) { if (!damaged) { damaged = true; health.Damage(10f); ShakeManager.Shake(ShakeManager.HugeIntensity, 0.5f); } } }
private void OnCollisionEnter(Collision collision) { GameObject obj = collision.gameObject; if (obj.CompareTag("Bullet")) { Vector3 knockbackdelta = -moveDirection * knockback; transform.Translate(knockbackdelta); ObjectPool bulPool = ObjectPoolManager.Instance.GetPool(obj.tag); if (bulPool != null) { bulPool.Destroy(obj); } flash = true; ShakeManager.Shake(ShakeManager.SmallIntensity, 0.2f); } }