private void positionToTarget(Transform target, TransformPosition position) { switch (position) { case TransformPosition.Above: positionAboveTarget(target); break; case TransformPosition.Centered: positionCenteredToTarget(target); break; } }
public void SetUp() { containingObject = new GameObject(); subject = containingObject.AddComponent <TransformPosition>(); }
public void AttachToTarget(Transform target, bool xEnabled, bool yEnabled, bool zEnabled, TransformPosition position) { changeButtonState(Button_X, xEnabled, target); changeButtonState(Button_X_Neg, xEnabled, target); changeButtonState(Button_Y, yEnabled, target); changeButtonState(Button_Y_Neg, yEnabled, target); changeButtonState(Button_Z, zEnabled, target); changeButtonState(Button_Z_Neg, zEnabled, target); transform.parent = target; positionToTarget(target, position); }
// Use this for initialization void Start() { instanciate = this; Position = transform.position; originalPosition = transform.position; }