SpriteFactory.Sprite.Locator.AttachChild
C#: int AttachChild (Transform child, [bool resetPosition = true], [bool resetRotation = true], [bool resetScale = true])
JS: function AttachChild (child : Transform, resetPosition : boolean, resetRotation : boolean, resetScale : boolean) : int
Description
Parent an object to this locator.
Set resetPosition = True to center the child on the locator.
False will leave child in the same position in world space as before.
Set resetRotation = True to zero the child's local rotation so the child is oriented to the locator.
False will leave the child oriented in the same rotation in world space as before.
Set resetScale = True to preserve the same local scale after parenting so that the child scales proportionately to the parent Sprite. Ex: If you are parenting an object into a scaled character's hand, set resetScale = True to make the object scale with the character.
False will leave the child at the same scale in world space as before.
Returns the index where the child was added. If the passed child is null or the transform was already in the list, return value is -1.
C#: int AttachChild (GameObject child, [bool resetPosition = true], [bool resetRotation = true], [bool resetScale = true])
JS: function AttachChild (child : GameObject, resetPosition : boolean, resetRotation : boolean, resetScale : boolean) : int
Description
Parent an object to this locator.
Set resetPosition = True to center the child on the locator.
False will leave child in the same position in world space as before.
Set resetRotation = True to zero the child's local rotation so the child is oriented to the locator.
False will leave the child oriented in the same rotation in world space as before.
Set resetScale = True to preserve the same local scale after parenting so that the child scales proportionately to the parent Sprite. Ex: If you are parenting an object into a scaled character's hand, set resetScale = True to make the object scale with the character.
False will leave the child at the same scale in world space as before.
Returns the index where the child was added. If the passed child is null or the transform was already in the list, return value is -1.
See Also
DetachChild