Version: 2017.1
public Transform transform ;


Transform входящего объекта, участвующего в коллизии.

See Also: класс Transform.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void OnCollisionEnter2D(Collision2D collision2D) { //If the object we collided with was an Asteroid. if ( == "Asteroid") { //Sets this object as the new parent of the Transform of the object involved in the collision. collision2D.transform.SetParent(gameObject.transform); } } }