コード例 #1
0
 /// <summary>
 /// Create a new InstantationParameters class that will set the position, rotation, and Transform parent of the instance.
 /// </summary>
 /// <param name="position">Position relative to the parent to set on the instance.</param>
 /// <param name="rotation">Rotation relative to the parent to set on the instance.</param>
 /// <param name="parent">Transform to set as the parent of the instantiated object.</param>
 public InstantiationParameters(Vector3 position, Quaternion rotation, Transform parent)
 {
     m_Position = position;
     m_Rotation = rotation;
     m_Parent   = parent;
     m_InstantiateInWorldPosition = false;
     m_SetPositionRotation        = true;
     m_OverrideInstantiate        = null;
 }
コード例 #2
0
 /// <summary>
 /// Create a new InstantationParameters class that will set the parent transform and use the prefab transform.
 /// </summary>
 /// <param name="parent">Transform to set as the parent of the instantiated object.</param>
 /// <param name="instantiateInWorldSpace">Flag to tell the IInstanceProvider whether to set the position and rotation on new instances.</param>
 /// <param name="overrideInstantiate">Override instantiate method.</param>
 public InstantiationParameters(Transform parent, bool instantiateInWorldSpace, OverrideInstantiate overrideInstantiate)
 {
     m_Position = Vector3.zero;
     m_Rotation = Quaternion.identity;
     m_Parent   = parent;
     m_InstantiateInWorldPosition = instantiateInWorldSpace;
     m_SetPositionRotation        = false;
     m_OverrideInstantiate        = overrideInstantiate;
 }