public void SetData(int prelevel, int afterlevel, string explain) { UISprite[] starSprites = U3DUtil.GetComponentsInChildren <UISprite>(MyHead.lblPreStar); NGUIUtil.SetStarLevelNum(starSprites, prelevel); starSprites = U3DUtil.GetComponentsInChildren <UISprite>(MyHead.lblAfterStar); NGUIUtil.SetStarLevelNum(starSprites, afterlevel); MyHead.lblExplain.text = explain; }
void Awake() { //自动关联Toogle MyHead.ToggleList = U3DUtil.GetComponentsInChildren <Transform>(MyHead.ToggleParent.gameObject, false); EventDelegate.Add(MyHead.BtnTrapsAll.onChange, BtnTrapAll_OnClickEventHandler); EventDelegate.Add(MyHead.BtnTrapsFire.onChange, BtnTrapFire_OnClickEventHandler); EventDelegate.Add(MyHead.BtnTrapsWater.onChange, BtnTrapWarter_OnClickEventHandler); EventDelegate.Add(MyHead.BtnTrapsPosion.onChange, BtnTrapPoison_OnClickEventHandler); EventDelegate.Add(MyHead.BtnTrapsGas.onChange, BtnTrapGas_OnClickEventHandler); EventDelegate.Add(MyHead.BtnTrapsThur.onChange, BtnTrapThur_OnClickEventHandler); //m_canShengji = null; }
void SetRoleStarLevel(int starLevel) { //Debug.Log("PrepareRoleWnd.cs SetStarLevel=" + starLevel); if (starLevel < 0 || starLevel > ConstantData.MaxStarLevel) { Debug.Log("PrepareRoleWnd.cs SetStarLevel=" + starLevel + " 的值非法"); } if (MyHead.StarListParent) { UISprite[] starSprites = U3DUtil.GetComponentsInChildren <UISprite>(MyHead.StarListParent); NGUIUtil.SetStarLevelNum(starSprites, starLevel); NGUIUtil.SetStarHidden(starSprites, starLevel); } }
public override void WndStart() { base.WndStart(); MyHead.BtnRelease.gameObject.SetActive(true); ChangeBiaoqing((int)CaptionExpress.idle, true); m_currentstate = GodSkillState.Idle; if (MyHead.BtnRelease) { MyHead.BtnRelease.OnPressDownEventHandler += BtnRelease_OnClickEventHandler; } m_captioninfo = BlackScienceDC.GetCaption(CmCarbon.GetCaptainID(true)); MyHead.lblLevel.text = m_captioninfo.m_level1.ToString(); NGUIUtil.Set2DSprite(MyHead.m_BiaoQingParent, "Textures/role/", m_captioninfo.m_captionid.ToString()); UISprite[] starSprites = U3DUtil.GetComponentsInChildren <UISprite>(MyHead.StarListParent); //NGUIUtil.SetStarLevelNum (starSprites,m_captioninfo.m_star); for (int i = 0; i < starSprites.Length; i++) { if (i >= m_captioninfo.m_star) { starSprites[i].gameObject.SetActive(false); } } UIGrid grid = MyHead.StarListParent.GetComponent <UIGrid>(); grid.Reposition(); if (m_captioninfo.GetGodSkillInfo().m_power2 > 0) { MyHead.LblDestroyPts.text = m_captioninfo.GetGodSkillInfo().m_power2.ToString(); } else { MyHead.LblDestroyPts.transform.parent.gameObject.SetActive(false); } }
void Awake() { //自动关联Toogle MyHead.ToggleList = U3DUtil.GetComponentsInChildren <Transform>(MyHead.ToggleParent.gameObject, false); }
static void Build() { string outPrefabPath = "Assets/Tencent/OutUI"; if (Selection.objects == null) { return; } List <string> outPaths = new List <string> (); Dictionary <string, GameObject> objList = new Dictionary <string, GameObject>(); string timePath = outPrefabPath + "/" + DateTime.Now.ToString("yyyyMMddHHmmss"); CreateDirectory(timePath); timePath += "/"; foreach (UnityEngine.Object o in Selection.objects) { WndBase [] gos = U3DUtil.GetComponentsInChildren <WndBase>((o as GameObject)); if (gos != null) { foreach (WndBase obj in gos) { string name = obj.GetType().ToString(); objList.Add(name, obj.gameObject); GameObject.DestroyImmediate(obj, true); } } WndBase wnd = (o as GameObject).GetComponent <WndBase>(); if (wnd != null) { GameObject.DestroyImmediate(wnd, true); } string inStr = AssetDatabase.GetAssetPath(o); string [] paths2 = AssetDatabase.GetDependencies(new string[] { inStr }); foreach (string pathItem in paths2) { string del = o.name + ".cs"; if (o.name.EndsWith("Item") || o.name.EndsWith("item")) { outPaths.Add(pathItem); } else if (pathItem.EndsWith(del) || pathItem.Contains("Assets/NGUI/Scripts")) { continue; } else { outPaths.Add(pathItem); } } } if (outPaths.Count < 1) { return; } string outUnit = timePath + Selection.objects[0].name + ".unitypackage"; // AssetDatabase.ExportPackage(outPaths.ToArray(), outUnit, ExportPackageOptions.Default); AssetDatabase.Refresh(); // foreach(UnityEngine.Object o in Selection.objects) // { //// Type type = GetType (o.name); //// object baseinfo= Activator.CreateInstance (type); // Component com = (o as GameObject).GetComponent(o.name); // if(com == null) // { // (o as GameObject).AddComponent(o.name); // } // // } // foreach(string key in objList.Keys) // { // GameObject obj; // objList.TryGetValue(key,out obj); // Component com = obj.GetComponent(key); // if(com == null) // { // obj.AddComponent(key); // } // // } }