using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class TriggerCity : MonoBehaviour { public List customIcons; /// /// 上移距离 /// public float upValue; private void OnEnable() { customIcons.ForEach(a => { a.anchoredPosition += new Vector2(0, upValue); }); } private void OnDisable() { customIcons.ForEach(a => { a.anchoredPosition -= new Vector2(0, upValue); }); } }