public void Hide(UILayerContainerType type) { UILayerContainerGo layerContainerGo = FindGoEntry(type); if (layerContainerGo != null) { for (int j = 0; j < layerContainerGo.ChildCount; j++) { GoEntry goEntry = layerContainerGo.ChildList[j]; GameObject go = goEntry.go; if (go != null) { go.SetActive(false); } } } /* * for (int index = 0; index < LayerContainerList.Count; index++) * { * UILayerContainerGo layerContainerGo = LayerContainerList[index]; * if (type == layerContainerGo.Type && type != UILayerContainerType.None) * { * for (int j = 0; j < layerContainerGo.ChildCount; j++) * { * GoEntry goEntry = layerContainerGo.ChildList[j]; * GameObject go = goEntry.go; * if (go != null) go.SetActive(false); * } * } * } * */ }
public void HideAll() { for (int index = 0; index < LayerContainerList.Count; index++) { UILayerContainerGo layerContainerGo = LayerContainerList[index]; for (int j = 0; j < layerContainerGo.ChildCount; j++) { GoEntry goEntry = layerContainerGo.ChildList[j]; GameObject go = goEntry.go; if (go != null) { go.SetActive(false); } } } }
public void Play(UILayerContainerType type) { UILayerContainerGo layerContainerGo = FindGoEntry(type); if (layerContainerGo != null) { for (int j = 0; j < layerContainerGo.ChildCount; j++) { GoEntry goEntry = layerContainerGo.ChildList[j]; GameObject go = goEntry.go; if (go != null) { go.SetActive(true); } } UtilCommon.VoidDelegate callback; CallbackMap.TryGetValue(type, out callback); if (callback != null) { callback(gameObject); } } /* * for (int index = 0; index < LayerContainerList.Count; index++) * { * UILayerContainerGo layerContainerGo = LayerContainerList[index]; * if (type == layerContainerGo.Type && type != UILayerContainerType.None ) * { * for (int j = 0; j < layerContainerGo.ChildCount; j++) * { * GoEntry goEntry = layerContainerGo.ChildList[j]; * GameObject go = goEntry.go; * if (go != null) go.SetActive(true); * } * UtilCommon.VoidDelegate callback; * CallbackMap.TryGetValue(type, out callback); * if (callback != null) * { * callback(gameObject); * } * } * } * */ }