透明小地图&列表点击切换&海拔图头像位移

This commit is contained in:
lishuo committed 2022-03-29 18:41:32 +08:00
1 parent bf48989a9c
commit 6ec4c0101b
114 files changed
+12787 -6517

No files matched your search

@@ -0,0 +1,35 @@
using UnityEngine;
using UnityEditor;
namespace PolyAndCode.UI
{
[ExecuteInEditMode]
public static class RecyclableScrollViewEditorTool
{
const string PrefabPath = "Assets/Recyclable Scroll Rect/Main/Prefab/Recyclable Scroll View.prefab";
[MenuItem("GameObject/UI/Recyclable Scroll View")]
private static void CreateRecyclableScrollView()
{
GameObject selected = Selection.activeGameObject;
//If selected isn't a UI gameobject then find a Canvas
if (!selected || !(selected.transform is RectTransform))
{
selected = GameObject.FindObjectOfType<Canvas>().gameObject;
}
if (!selected) return;
GameObject asset = AssetDatabase.LoadAssetAtPath(PrefabPath, typeof(GameObject)) as GameObject;
GameObject item = Object.Instantiate(asset);
item.name = "Recyclable Scroll View";
item.transform.SetParent(selected.transform);
item.transform.localPosition = Vector3.zero;
Selection.activeGameObject = item;
Undo.RegisterCreatedObjectUndo(item, "Create Recycalable Scroll view");
}
}
}