//根据挂点获取特效位置 public static List <Vector2> getArtPos(Transform tran, ConfGuid confguid) { List <Vector2> artPos = new List <Vector2>(); if (confguid.artIDs == null || confguid.artIDs.Length == 0) { return(artPos); } for (int i = 0; i < confguid.artIDs.Length; i++) { ConfGuidArt guidArt = ConfGuidArt.Get(confguid.artIDs[i]); string btnStr = guidArt.artAnchor.Replace(":", "/"); Transform artTran = tran.Find(btnStr); if (artTran != null) { Vector2 pos = artTran.position; if (guidArt.artShift.Length == 2) { pos += new Vector2(guidArt.artShift[0], guidArt.artShift[1]); } artPos.Add(pos); } } return(artPos); }
private void InitArt(List <Vector2> pos, ConfGuid confGuid) //, List<string> path { m_artGrid.EnsureSize <GameUIEffect>(pos.Count); for (int i = 0; i < pos.Count; i++) { ConfGuidArt guidArt = ConfGuidArt.Get(confGuid.artIDs[i]); GameUIEffect uiEffect = m_artGrid.GetChild <GameUIEffect>(i); //uiEffect.SetRealScale(new Vector3(guidArt.artScale[0],guidArt.artScale[1],1)); uiEffect.EffectPrefabName = guidArt.artPath; Vector3 localPos = GuidTools.WordToLocalPos(m_RectRoot, pos[i]); uiEffect.gameObject.transform.localPosition = new Vector3(localPos.x, localPos.y, 0); uiEffect.Visible = true; } }