검색 페이지 ui 작업
This commit is contained in:
parent
3b26b6ab17
commit
e1f456d611
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,67 @@
|
|||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Common : MonoBehaviour
|
||||
{
|
||||
[SerializeField] TMP_Dropdown dAnimal;
|
||||
[SerializeField] TMP_Dropdown dSuitStyle;
|
||||
[SerializeField] TMP_Dropdown dSuitType;
|
||||
[SerializeField] TMP_Dropdown dRegion;
|
||||
//내부 저장 기능 만들기
|
||||
//버전 기능 까지 만들어서 버전 체크후 새로 다운받아오게 만들기.
|
||||
List<CommonData> animalTypes;
|
||||
List<CommonData> suitStyle;
|
||||
List<CommonData> suitType;
|
||||
List<CommonData> region;
|
||||
void Start()
|
||||
{
|
||||
NetworkManager.Instance.CreateRequest<List<CommonData>>("common/animalTypes", new object(), (data) =>
|
||||
{
|
||||
animalTypes = data;
|
||||
List<string> strings = new List<string>();
|
||||
for(int n = 0; n < data.Count; n++)
|
||||
{
|
||||
strings.Add(data[n].code_nm);
|
||||
}
|
||||
dAnimal.AddOptions(strings);
|
||||
}, null, BestHTTP.HTTPMethods.Get);
|
||||
NetworkManager.Instance.CreateRequest<List<CommonData>>("common/suitStyle", new object(), (data) =>
|
||||
{
|
||||
suitStyle = data;
|
||||
List<string> strings = new List<string>();
|
||||
for (int n = 0; n < data.Count; n++)
|
||||
{
|
||||
strings.Add(data[n].code_nm);
|
||||
}
|
||||
dSuitStyle.AddOptions(strings);
|
||||
}, null, BestHTTP.HTTPMethods.Get);
|
||||
NetworkManager.Instance.CreateRequest<List<CommonData>>("common/suitType", new object(), (data) =>
|
||||
{
|
||||
suitType = data;
|
||||
List<string> strings = new List<string>();
|
||||
for (int n = 0; n < data.Count; n++)
|
||||
{
|
||||
strings.Add(data[n].code_nm);
|
||||
}
|
||||
dSuitType.AddOptions(strings);
|
||||
}, null, BestHTTP.HTTPMethods.Get);
|
||||
NetworkManager.Instance.CreateRequest<List<CommonData>>("common/region", new object(), (data) =>
|
||||
{
|
||||
region = data;
|
||||
List<string> strings = new List<string>();
|
||||
for (int n = 0; n < data.Count; n++)
|
||||
{
|
||||
strings.Add(data[n].code_nm);
|
||||
}
|
||||
dRegion.AddOptions(strings);
|
||||
}, null, BestHTTP.HTTPMethods.Get);
|
||||
}
|
||||
|
||||
public class CommonData
|
||||
{
|
||||
public string code_nm;
|
||||
public string code_id;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class SearchCtrl : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameObject opsion;
|
||||
|
||||
public void OpsionButton()
|
||||
{
|
||||
opsion.SetActive(!opsion.activeSelf);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
using UnityEngine;
|
||||
using BestHTTP;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
public class NetworkManager : SingletonMonoBehaviour<NetworkManager>
|
||||
|
|
@ -30,7 +31,7 @@ public class NetworkManager : SingletonMonoBehaviour<NetworkManager>
|
|||
}
|
||||
else
|
||||
{
|
||||
T deSerialized = JsonUtility.FromJson<T>(response.DataAsText);
|
||||
T deSerialized = JsonConvert.DeserializeObject<T>(response.DataAsText);
|
||||
onSuccess?.Invoke(deSerialized);
|
||||
}
|
||||
});
|
||||
|
|
@ -38,7 +39,7 @@ public class NetworkManager : SingletonMonoBehaviour<NetworkManager>
|
|||
if (serializeData != null)
|
||||
{
|
||||
httpRquest.SetHeader("Content-Type", "application/json; charset=UTF-8");
|
||||
string json = JsonUtility.ToJson(serializeData);
|
||||
string json = JsonConvert.SerializeObject(serializeData);
|
||||
httpRquest.RawData = System.Text.Encoding.UTF8.GetBytes(json);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class Test : MonoBehaviour
|
|||
}
|
||||
void Update()
|
||||
{
|
||||
text.text = $"x : {canvas.transform.position.x}, y : {canvas.transform.position.y}\nip : {apiResponse.test}";
|
||||
text.text = $"x : {canvas.transform.position.x}, y : {canvas.transform.position.y}\nip : {(apiResponse == null ? "null": apiResponse.test)}";
|
||||
}
|
||||
public class ApiResponse
|
||||
{
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
Reference in New Issue