0

I am making a select wheel using NGUI scrollview and "UICenter on child". It works perfect as it is, but I would be like to be able to, when fired, to set a default item as the "selected / center" child? How can i accomplish that? Is there a parameter I can set for the scrollview?

Hoping for a little help in this matter and merry christmas ;-)

Mansa
  • 2,277
  • 10
  • 37
  • 67

1 Answers1

0

Yes, you just have to tell the UICenterOnChild component what Transform you want to center on. The easiest way to do this is to attach a small script to the scrollview that has the UICenterOnChild component and do something like:

public UICenterOnChild MyCenterOnChildObject;
public Transform SomeTransform;

void SetDefaultChild() {
    this.MyCenterOnChildObject.CenterOn(this.SomeTransform);
}
stromdotcom
  • 381
  • 1
  • 8