internal void Update() { if (Input.GetKeyDown(KeyCode.Minus)) { player.DamageObj(.5f); } else if (Input.GetKeyDown(KeyCode.Equals)) { player.DamageObj(-.5f); } }
// Update is called once per frame void Update() { float newSpeed = m_physics.m_trueVelocity.magnitude; float delta = newSpeed - m_lastSpeed; if (Mathf.Abs(delta) > MinimumVelocityChangeForDamage) { m_attackable.DamageObj(SelfDamageAmount); } m_lastSpeed = m_physics.m_trueVelocity.magnitude; }