68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
using Assets.Scripts;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class NewRouteOverviewController: PFUIPanel
|
|
{
|
|
// Start is called before the first frame update
|
|
Transform tmpGroup;
|
|
Transform tmpItem;
|
|
void Start()
|
|
{
|
|
tmpGroup = Resources.Load<Transform>("UI/Prefab/NewRoute/RouteGroup");
|
|
tmpItem = Resources.Load<Transform>("UI/Prefab/NewRoute/RouteItem");
|
|
var rect = transform.Find("Container/Right/Scroll View/Viewport/Content")
|
|
.GetComponent<RectTransform>();
|
|
|
|
for (int i = 0; i < 10; i++)
|
|
{
|
|
var group = Instantiate<Transform>(tmpGroup);
|
|
for (int j = 0; j < 10; j++)
|
|
{
|
|
var item = Instantiate<Transform>(tmpItem);
|
|
item.SetParent(group.Find("Content"));
|
|
}
|
|
group.SetParent(rect);
|
|
group.localScale = Vector3.one;
|
|
}
|
|
LayoutRebuilder.ForceRebuildLayoutImmediate(rect);
|
|
|
|
var left = transform.Find("Container/Left");
|
|
UIManager.AddEvent(left.Find("MyUpload").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
|
{
|
|
ToList("My Upload");
|
|
});
|
|
UIManager.AddEvent(left.Find("MyCollection").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
|
{
|
|
ToList("My Collection");
|
|
});
|
|
UIManager.AddEvent(left.Find("RecentRoute").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
|
{
|
|
ToList("Recent Routes");
|
|
});
|
|
UIManager.AddEvent(left.Find("AllRoutes").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
|
{
|
|
ToList("All Route");
|
|
});
|
|
}
|
|
|
|
void ToList(string type)
|
|
{
|
|
App.CurrentRouteType = type;// "";
|
|
UIManager.ShowMapListPanel();
|
|
}
|
|
public override void Show()
|
|
{
|
|
base.Show();
|
|
Debug.Log("触发59");
|
|
transform.MyDOFade();
|
|
}
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
}
|