public void Shoot(Vector3 _dir) { m_rigibody.AddForce(_dir * ShootSpeed); Ray ray = new Ray(transform.position, _dir); RaycastHit hit; if (Physics.Raycast(ray, out hit, ShootDis, HitLayerMask)) { TankController con = hit.transform.GetComponent <TankController>(); con.Die(); Owner.GetComponent <TankController>().KillSomeOne(); } }