FuZhou_Custom_BulkCargo_3D/FuZhou_FirstPage/Assets/Scripts/Auto/TriggerCity.cs

29 lines
589 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TriggerCity : MonoBehaviour
{
public List<RectTransform> customIcons;
/// <summary>
/// 上移距离
/// </summary>
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);
});
}
}