修改细节
This commit is contained in:
1 parent
1002b0433a
commit
86a5b68317
39 files changed
+3489
-2760
No files matched your search
@@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 70c79ab2ae1f7d74ba14708c3d4a2e6d
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,19 +0,0 @@
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Cyp.Common
|
||||
{
|
||||
public static class Global
|
||||
{
|
||||
public static UserResultModel CurrentUser { get; set; }
|
||||
public static UserApi userApi = new UserApi();
|
||||
public static MapApi mapApi = new MapApi();
|
||||
public static MapInterruptRecordApi mapInterruptRecordApi = new MapInterruptRecordApi();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f084ba73ccb087147bbf5c9d7201a06e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,60 +0,0 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Cyp.Common
|
||||
{
|
||||
public static class Utils
|
||||
{
|
||||
|
||||
/*显示简略提示,需要拖Toast的预制件,且保证其他组件名字不是Toast,ToastContainer*/
|
||||
public static void showToast(GameObject game,string text,int duration = 1)
|
||||
{
|
||||
var toast = Utils.FindUpParent(game.transform).Find("ToastContainer");
|
||||
if (toast!=null)
|
||||
{
|
||||
toast.GetComponent<Toast>().showToast(JsonConvert.SerializeObject(new
|
||||
{
|
||||
text,
|
||||
duration
|
||||
}));
|
||||
//toast.SendMessage("showToast", );
|
||||
}
|
||||
}
|
||||
/*显示简略提示,需要拖Toast的预制件,且保证其他组件名字不是Toast,ToastContainer*/
|
||||
|
||||
/*显示网络图片*/
|
||||
public delegate Coroutine StartCoroutine(IEnumerator routine);
|
||||
public static void DisplayImage(StartCoroutine startCoroutine,RawImage img, string url)
|
||||
{
|
||||
startCoroutine(DownloadImage(img, url));
|
||||
}
|
||||
static IEnumerator DownloadImage(RawImage img,string MediaUrl)
|
||||
{
|
||||
UnityWebRequest request = UnityWebRequestTexture.GetTexture(MediaUrl);
|
||||
yield return request.SendWebRequest();
|
||||
if (request.isNetworkError || request.isHttpError)
|
||||
Debug.Log(request.error);
|
||||
else
|
||||
img.texture = ((DownloadHandlerTexture)request.downloadHandler).texture;
|
||||
}
|
||||
/*显示网络图片*/
|
||||
|
||||
/*获取最顶层对象*/
|
||||
public static Transform FindUpParent(Transform zi)
|
||||
{
|
||||
if (zi.parent == null)
|
||||
return zi;
|
||||
else
|
||||
return FindUpParent(zi.parent);
|
||||
}
|
||||
/*获取最顶层对象*/
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b26057ccd9f0954f8ffbddd5c7ca8a8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class DemoScript : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Button button;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
button.onClick.AddListener(()=>
|
||||
{
|
||||
SceneManager.UnloadSceneAsync("4-Demo");
|
||||
});
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 232bc1a830e1f7344887323f3b110026
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,30 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ImageRotate : MonoBehaviour
|
||||
{
|
||||
float rotation = 360;
|
||||
// Use this for initialization
|
||||
void Start()
|
||||
{
|
||||
//Debug.Log ("Material used: "+animMat.name);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
Debug.Log(Time.deltaTime);
|
||||
transform.Rotate(Vector3.back);
|
||||
//if (Time.frameCount % 1 == 0)
|
||||
//{
|
||||
// float i = new System.Random().NextDouble() < .5 ? -0.5f : 2f;
|
||||
// transform.rotation = Quaternion.Euler(0, 0, rotation += (float)(i * new System.Random().NextDouble()));
|
||||
// if (rotation < 0)
|
||||
// {
|
||||
// rotation = 360;
|
||||
// }
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 219017a4cf0dd2d4b8118d5723644209
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,68 +0,0 @@
|
||||
using Assets.Cyp.Common;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class Main : MonoBehaviour
|
||||
{
|
||||
[SerializeField] Text NickName;
|
||||
[SerializeField] Text TotalKM;
|
||||
[SerializeField] RawImage Avatar;
|
||||
[SerializeField] GameObject BtnRide;
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
if (Global.CurrentUser != null)
|
||||
{
|
||||
SetCurrentUser();
|
||||
}
|
||||
GetSummary();
|
||||
if (BtnRide != null)
|
||||
{
|
||||
BtnRide.GetComponent<Button>().onClick.AddListener(GoRide);
|
||||
}
|
||||
}
|
||||
void GoRide()
|
||||
{
|
||||
SceneManager.LoadScene("3-MapList");
|
||||
Utils.showToast(gameObject,"去骑行");
|
||||
}
|
||||
void SetCurrentUser()
|
||||
{
|
||||
var user = Global.CurrentUser;
|
||||
NickName.text = user.Nickname;
|
||||
Utils.DisplayImage(StartCoroutine, Avatar, user.WxHeadImg);
|
||||
}
|
||||
void GetSummary()
|
||||
{
|
||||
var res = Global.userApi.GetSummary();
|
||||
if (res.result)
|
||||
{
|
||||
TotalKM.text = $"{res.data.TotalDistance.ToString("#0.00")}KM";
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(gameObject, res.errMsg);
|
||||
}
|
||||
//var res = await NoAuthApi.GetCurrentUser();
|
||||
//if (res.result)
|
||||
//{
|
||||
// Global.CurrentUser = res.data;
|
||||
// SetCurrentUser();
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// Utils.showToast(gameObject, res.errMsg);
|
||||
//}
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f568140fc83dae647a243568c6c096b9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user