private void AddSpellSlot() { GameObject gameObject = NGUITools.AddChild(m_grid.gameObject, m_spellSlotPrefab); SpellSlot component = gameObject.GetComponent <SpellSlot>(); m_spellSlots.Add(component); component.Index = m_spellSlots.Count - 1; component.Parent = this; ScrollingHelper.InitScrollListeners(this, gameObject); }
public static void InitScrollListeners(IScrollingListener p_listener, GameObject p_go) { ScrollingHelper[] componentsInChildren = p_go.GetComponentsInChildren <ScrollingHelper>(); for (Int32 i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].Init(p_listener); } ScrollingHelper component = p_go.GetComponent <ScrollingHelper>(); if (component != null) { component.Init(p_listener); } }
private void Start() { ScrollingHelper.InitScrollListeners(this, m_scrollBar.gameObject); }