Example #1
0
    public void Start()
    {
        if (this.items.Count > 0) {
            float x = 0;
            foreach (var item in this.items) {
                this.addTabInit(item);

                Transform transform = item.transform;
                transform.localPosition = new Vector3(x, 0f, 0f);

                x += this.padding + transform.localScale.x;
            }

            if (this.current == null) {
                this.current = this.items[0];
            }
            this.OnActive(this.current);
        }
    }
Example #2
0
 protected void addTabInit(GTabButton button)
 {
     button.tabs = this;
 }
Example #3
0
 public void OnActive(GTabButton caller)
 {
     this.container.OnActive(caller.content);
 }
Example #4
0
 public void addTab(GTabButton button)
 {
     this.items.Add(button);
     this.addTabInit(button);
 }