void OnTriggerEnter2D(Collider2D hitInfo) { //Debug.Log(hitInfo.name); Destroy(gameObject); RobotAgent enemy = hitInfo.GetComponent <RobotAgent>(); if (enemy != null) { enemy.AddReward(-1.0f); shooter.AddReward(1.0f); //Debug.Log(shooter.transform.position.x.ToString()); //Debug.Log(enemy.transform.position.x.ToString()); shooter.Done(); enemy.Done(); } }