搜索面板条件关闭重新打开重置

This commit is contained in:
lishuo 2021-05-26 18:04:58 +08:00
parent 4e4da38252
commit e88f32e99b
8 changed files with 2780 additions and 2674 deletions

View File

@ -11,9 +11,9 @@ GameObject:
- component: {fileID: 1148602845821646045}
- component: {fileID: 1148602845821646048}
- component: {fileID: 1148602845821646051}
- component: {fileID: 1148602845821646050}
- component: {fileID: 6957187063806588864}
m_Layer: 5
m_Name: arrow
m_Name: MiniArrow
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
@ -65,8 +65,8 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_Sprite: {fileID: 21300000, guid: 8a1f5dd0a18144c498c99139fcfa3547, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
@ -75,7 +75,7 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &1148602845821646050
--- !u!114 &6957187063806588864
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -84,7 +84,10 @@ MonoBehaviour:
m_GameObject: {fileID: 1148602845821646044}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: adb30198aa32dd140b5750692dd48104, type: 3}
m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3}
m_Name:
m_EditorClassIdentifier:
radius: 4
m_Inverse: 0
m_MaskInteraction: 85
m_UseStencil: 1
m_RaycastFilter: 0

File diff suppressed because it is too large Load Diff

View File

@ -45,11 +45,13 @@ namespace Assets.Scenes.Ride.Scripts
MapApi mapApi;
Sprite down;
Sprite up;
Transform parent;
private void Awake()
{
mapApi = new MapApi();
cyclingController = FindObjectOfType<CyclingController>();
//分页查询当前路数排行榜选手成绩列表
parent = transform.Find("Panel/PlayerList/Scroll View/Viewport/Content");
prefab = Resources.Load<GameObject>("UI/Prefab/Ride/SelectPlayerItem");
down = Resources.Load<Sprite>("Images/DOWN");
up = Resources.Load<Sprite>("Images/UP");
@ -111,6 +113,11 @@ namespace Assets.Scenes.Ride.Scripts
OnEndDrag(null);
}
}
if (Input.GetKeyDown(KeyCode.Return))
{
Search(null);
}
bool enabled = gameObjects.Where(c => c.GetComponent<SeletedPlayerScript>().isUsed).Count() > 0;
rideButton.enabled = enabled;
rideButton.interactable = enabled;
@ -193,14 +200,38 @@ namespace Assets.Scenes.Ride.Scripts
reviewPanel.SetActive(false);
selectPanel.SetActive(true);
nearPanel.SetActive(false);
Reset();
}
private void Reset()
{
inputField.text = string.Empty;
startValue.text = string.Empty;
endValue.text = string.Empty;
pageIndex = 0;
pageSize = 8;
totalPages = 0;
seachName = string.Empty;
_startValue = 0;
_endValue = 0;
foreach (var item in gameObjects)
{
item.GetComponent<SeletedPlayerScript>().Reset();
}
parent.DestroyChildren();
sort = 0;
sortImage.sprite = down;
}
private void Start()
{
//CreateGameObject(cyclingController.mapRouteRankingList);
Refresh();
//Refresh();
}
private void Refresh()
public void Refresh()
{
var list = mapApi.GetShadowList(App.RouteIdParam, seachName, pageIndex, pageSize);
totalPages = list.data.TotalPages;
@ -225,7 +256,7 @@ namespace Assets.Scenes.Ride.Scripts
}
private void CreateGameObject(List<MapRouteRanking> list)
{
var parent = transform.Find("Panel/PlayerList/Scroll View/Viewport/Content");
int index = 0;
foreach (var item in list)
{

View File

@ -189,19 +189,6 @@ namespace Assets.Scenes.Ride.Scripts
//小地图进度
miniMapProcess = transform.Find("Panel/MiniMap/Process").GetComponent<Image>();
miniMapProcessText = transform.Find("Panel/MiniMap/Process/Text").GetComponent<Text>();
//开发者视角调整
cameraSlider = transform.Find("Panel/CameraSlider").GetComponent<Slider>();
Text Cameray = transform.Find("Panel/CameraSlider/Text").GetComponent<Text>();
string[] phoneList = new string[] { "18120141032", "15651831367", "13115011550","15261826280" };
if (phoneList.Contains(App.CurrentUser.Phone))
{
cameraSlider.gameObject.SetActive(true);
cameraSlider.onValueChanged.AddListener((f) =>
{
cameraY = f;
Cameray.text = f.ToString("f0");
});
}
UIManager.AddEvent(startBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, StartRide);
UIManager.AddEvent(simpleBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ClearPanel);
@ -290,6 +277,21 @@ namespace Assets.Scenes.Ride.Scripts
cameraY = float.Parse(cameraArr[1]);
cameraZ = float.Parse(cameraArr[2]);
}
//开发者视角调整
cameraSlider = transform.Find("Panel/CameraSlider").GetComponent<Slider>();
Text CameraText = transform.Find("Panel/CameraSlider/Text").GetComponent<Text>();
string[] phoneList = new string[] { "18120141032", "15651831367", "13115011550", "15261826280" };
if (phoneList.Contains(App.CurrentUser.Phone))
{
cameraSlider.gameObject.SetActive(true);
cameraSlider.value = cameraY;
CameraText.text = cameraY.ToString("f0");
cameraSlider.onValueChanged.AddListener((f) =>
{
cameraY = f;
CameraText.text = f.ToString("f0");
});
}
//路书基本信息绑定
mapName.text = routeInstance.Name;
totalDistance.text = Math.Round(mainController.GetMapData().TotalDistance, 1).ToString() + "KM";//总里程
@ -390,7 +392,11 @@ namespace Assets.Scenes.Ride.Scripts
if (count == 0)
{
mainController.SetStart();
countDownTxt.transform.GetComponent<CanvasGroup>().DOFade(0, 1);
var canvasGroup = countDownTxt.transform.GetComponent<CanvasGroup>();
canvasGroup.DOFade(0, 1).onComplete+=()=> {
countDownTxt.gameObject.SetActive(false);
canvasGroup.alpha = 1;
};
}
if (count == 1 && mainController.cyclingModel == CyclingModel.Single)
{
@ -474,6 +480,7 @@ namespace Assets.Scenes.Ride.Scripts
selectPanel.SetActive(false);
//显示影子选手骑行列表
selectPlayer.SetActive(true);
selectPlayer.GetComponent<SelectPlayerFactory>().Refresh();
//显示附近的人列表
nearByPanel.SetActive(true);
}

View File

@ -317,6 +317,51 @@ public class MapListController : PFUIPanel
isEnd = false;
GetList();
}
public void ResetPanel()
{
if (searchInput != null)
{
//empty Data
ftname = string.Empty;
hands = new List<string>();
var text = distanceOptions.GetComponent<Dropdown>().options[0].text;
distance = MapFilterOptions.distanceDict[text];
is3d = false;
isFav = false;
//empty ui
searchInput.GetComponent<InputField>().text = string.Empty;
var dDropdown = distanceOptions.GetComponent<Dropdown>();
dDropdown.value = 0;
if (diffOptions != null)
{
foreach (Transform t in diffOptions)
{
var button = t.GetComponent<Button>();
var image = t.GetComponent<Image>();
var buttonText = t.Find("Text").GetComponent<Text>();
ColorUtility.TryParseHtmlString("#23232D", out Color c);
//ColorUtility.TryParseHtmlString("#F93086", out Color c);
image.color = c;
buttonText.color = new Color(1, 1, 1, 1);
}
}
var isfav = favContainer.Find("Gou").gameObject;
isfav.SetActive(false);
var is3dUI = tdContainer.Find("Gou").gameObject;
is3dUI.SetActive(false);
if (sorts != null)
{
var drop = sorts.GetComponent<Dropdown>();
drop.value = 0;
}
Refresh();
}
}
void ResetList()
{
distance = "";

View File

@ -114,6 +114,13 @@ public class UserInfoController : PFUIPanel
}
}
public void Reset()
{
if (summaryPanel != null)
{
summaryPanel.Find("Panel").Find("RideResultList").GetComponent<ResultListController>().Reset();
}
}
// Update is called once per frame
void Update()
{

View File

@ -128,6 +128,17 @@ public class ResultListController : MonoBehaviour
pageIndex[scrollIndex] = 0;
GetList();
}
public void Reset()
{
if (searchInput != null)
{
searchInput.GetComponent<InputField>().text = "";
name = "";
Load();
StartScroll(1);
}
}
Dictionary<int, bool> isEnd = new Dictionary<int, bool>
{
{0,false },{1,false }

View File

@ -343,6 +343,7 @@ public class UIManager : MonoBehaviour
public static void ShowUserInfoPanel()
{
UIManager.Instance.UserInfoPanel.Reset();
UIManager.Show(UIManager.Instance.UserInfoPanel, UIManager.Instance.MainPanel);
}
@ -419,6 +420,7 @@ public class UIManager : MonoBehaviour
{
Debug.Log("清空");
//App.propTextureCache["recordCache"].Clear();
UIManager.Instance.MapListPanel.ResetPanel();
UIManager.Show(UIManager.Instance.MapListPanel, UIManager.Instance.MainPanel);
}
public static void ShowMapDetailPanel(int id)