예제 #1
0
    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);
            }
        }
    }
예제 #2
0
 public void UnRegister(IBullets value)
 {
     iBullets.Remove(value);
     size_bullets--;
 }
예제 #3
0
 public void Register(IBullets value)
 {
     iBullets.Add(value);
     size_bullets++;
 }