private void OnCollisionEnter(Collision other) { ContactPoint[] points = other.contacts; //TODO: если проблема не здесь то убрать цикл for (int i = 0; i < points.Length; i++) { IBullets bullet = other.gameObject.GetComponent <IBullets>(); if (bullet != null) { _rigidbody.AddForce(points[i].normal * 100f); } } }
public void UnRegister(IBullets value) { iBullets.Remove(value); size_bullets--; }
public void Register(IBullets value) { iBullets.Add(value); size_bullets++; }