public static UIToggleSlider AttachTo(GameObject go, int count, System.Action <int, Transform> onViewRefresh) { if (go != null) { UIToggleSlider slider = go.GetComponent <UIToggleSlider>(); if (slider == null) { slider = go.AddComponent <UIToggleSlider>(); } if (slider != null) { slider.Initialize(count, onViewRefresh); } return(slider); } return(null); }
public static UIToggleSlider AttachTo(GameObject go, int count) { if (go != null) { UIToggleSlider slider = go.GetComponent <UIToggleSlider>(); if (slider == null) { slider = go.AddComponent <UIToggleSlider>(); } if (slider != null) { slider.Initialize(count); } return(slider); } return(null); }