调整后提交
This commit is contained in:
1 parent
a2de06fede
commit
affc775226
100 files changed
+6319
-2125
No files matched your search
@@ -17,7 +17,7 @@ namespace Assets.Scripts.Apis
|
||||
protected async override Task<HttpResponseMessage> SendAsync(
|
||||
HttpRequestMessage request, CancellationToken cancellationToken)
|
||||
{
|
||||
var badreqText = App.GetLocalLanguage() == "zh" ? "请检查网络连接是否正常" : "Please check if the network connection is normal.";
|
||||
var badreqText = App.GetLocalString("Please check the network status!");
|
||||
try
|
||||
{
|
||||
var response = await base.SendAsync(request, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -259,8 +259,8 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
|
||||
this.AveragePace = 0;
|
||||
this.InstantaneousPower = 0;
|
||||
this.AveragePower = 0;
|
||||
this.commonRes = 50;
|
||||
this.thinkRes = 50;
|
||||
//this.commonRes = 50;
|
||||
//this.thinkRes = 50;
|
||||
//this.ResistanceLevel = 0;
|
||||
this.TotalEnergy = 0;
|
||||
this.EnergyPerHour = 0;
|
||||
|
||||
@@ -90,7 +90,7 @@ public class RowerHomeScript : PFUIPanel
|
||||
Transform left, bottom, mid;
|
||||
float timer = 1.0f;
|
||||
List<DoubleVector2> pullList = new List<DoubleVector2>();
|
||||
public Dictionary<object, Sprite> spriteDict;
|
||||
public Dictionary<object, Sprite> spriteDict,spriteDict2;
|
||||
List<string> records;
|
||||
List<TempRowerCalc> values;
|
||||
DateTime startTime,createTime;
|
||||
@@ -136,6 +136,24 @@ public class RowerHomeScript : PFUIPanel
|
||||
{13,Resources.Load<Sprite>("Images/Rower/序列帧/划船机0014") },
|
||||
{14,Resources.Load<Sprite>("Images/Rower/序列帧/划船机0015") },
|
||||
};
|
||||
spriteDict2 = new Dictionary<object, Sprite>()
|
||||
{
|
||||
{0,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0001") },
|
||||
{1,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0002") },
|
||||
{2,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0003") },
|
||||
{3,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0004") },
|
||||
{4,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0005") },
|
||||
{5,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0006") },
|
||||
{6,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0007") },
|
||||
{7,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0008") },
|
||||
{8,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0009") },
|
||||
{9,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0010") },
|
||||
{10,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0011") },
|
||||
{11,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0012") },
|
||||
{12,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0013") },
|
||||
{13,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0014") },
|
||||
{14,Resources.Load<Sprite>("Images/RowerNew/序列帧/划船机0015") },
|
||||
};
|
||||
GetComponent<RectTransform>().localScale = Vector3.one;
|
||||
GetComponent<RectTransform>().localPosition = Vector3.zero;
|
||||
|
||||
@@ -189,7 +207,9 @@ public class RowerHomeScript : PFUIPanel
|
||||
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
|
||||
var c1 = new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/RowerNew/ICON_create_44"), () =>
|
||||
{
|
||||
//UIManager.ShowRowerWelldone("33171855-66FC-4121-935C-0F4DA98E5BB2");
|
||||
//UIManager.ShowRowerWelldone("33171855-66FC-4121-935C-0F4DA98E5BB2", Init);
|
||||
//return;
|
||||
//UIManager.ShowRowerWelldone("2B6E8414-AF47-4B49-99E9-A89B83C65305", Init);
|
||||
//return;
|
||||
if (checkRowing()) return;
|
||||
if (C2RowerData.IsEnabled == true && C2RowerData.rowerType != null) return;
|
||||
@@ -242,13 +262,27 @@ public class RowerHomeScript : PFUIPanel
|
||||
//RowerPanel/Rower/Bottom/Expected/Title
|
||||
//var dw = rowerType.type == 1 ? $"{rowerType.value}M" : $"{(rowerType.value / 60).ToString("#0.00")}Min";
|
||||
//bottom.Find("Expected/Title").GetComponent<Text>().text = $"EST\n/ {dw}";
|
||||
var dw = rowerType.type == 1 ? $"" : $"\nM";
|
||||
var dw = "";
|
||||
if (rowerType.type == 0)
|
||||
{
|
||||
dw = $"\nM/ 30Min";
|
||||
}
|
||||
else if (rowerType.type == 2)
|
||||
{
|
||||
dw = $"\nM";
|
||||
}
|
||||
bottom.Find("Expected/Title").GetComponent<Text>().text = $"{App.GetLocalString("EST")}{dw}";
|
||||
}
|
||||
}
|
||||
|
||||
private void Discard()
|
||||
{
|
||||
if (Application.internetReachability == NetworkReachability.NotReachable)
|
||||
{
|
||||
transform.Find("Stopped").gameObject.SetActive(true);
|
||||
Utils.showToast(null, App.GetLocalString("Please check the network status!"));
|
||||
return;
|
||||
}
|
||||
transform.Find("Stopped").gameObject.SetActive(false);
|
||||
openTimer = false;
|
||||
isPause = true;
|
||||
@@ -268,10 +302,19 @@ public class RowerHomeScript : PFUIPanel
|
||||
{
|
||||
Rower.Reset();
|
||||
}
|
||||
reRowData = null;
|
||||
//RowerPanel/Rower/Bottom/Expected/Title
|
||||
//var dw = rowerType.type == 1 ? $"{rowerType.value}M" : $"{(rowerType.value / 60).ToString("#0.00")}Min";
|
||||
//bottom.Find("Expected/Title").GetComponent<Text>().text = $"EST\n/ {dw}";
|
||||
var dw = rowerType.type == 1 ? $"" : $"\nM";
|
||||
var dw = "";
|
||||
if (rowerType.type == 0)
|
||||
{
|
||||
dw = $"\nM/ 30Min";
|
||||
}
|
||||
else if (rowerType.type == 2)
|
||||
{
|
||||
dw = $"\nM";
|
||||
}
|
||||
bottom.Find("Expected/Title").GetComponent<Text>().text = $"{App.GetLocalString("EST")}{dw}";
|
||||
Init();
|
||||
//Utils.showToast(null, "请滑动划船机并开始", isLowest: true, type: 1);
|
||||
@@ -319,8 +362,16 @@ public class RowerHomeScript : PFUIPanel
|
||||
//Utils.showToast()
|
||||
Action f = () =>
|
||||
{
|
||||
Save();
|
||||
Init();
|
||||
reRowData = null;
|
||||
if (tempRecordData == null)
|
||||
{
|
||||
if (Save()) Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SaveFunc(tempRecordData.model, tempRecordData.files)) Init();
|
||||
}
|
||||
|
||||
};
|
||||
if (C2RowerData.IsEnabled == true)
|
||||
{
|
||||
@@ -398,6 +449,10 @@ public class RowerHomeScript : PFUIPanel
|
||||
|
||||
private void StartFunc()
|
||||
{
|
||||
if (transform.parent.parent.Find("ModalPanel/RowerWelldone(Clone)") && transform.parent.parent.Find("ModalPanel/RowerWelldone(Clone)").gameObject.activeInHierarchy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
//设定一个标准 如果满足条件不让他开始
|
||||
if (C2RowerData.IsEnabled && RowerData != null && RowerData.ElapsedTime >= 5)
|
||||
{
|
||||
@@ -415,11 +470,46 @@ public class RowerHomeScript : PFUIPanel
|
||||
timer = 1.0f;
|
||||
}
|
||||
transform.Find("Ready").gameObject.SetActive(false);
|
||||
//if (UIManager.Instance.RowerWelldone)
|
||||
//{
|
||||
// UIManager.Instance.RowerWelldone.CloseModal();
|
||||
//}
|
||||
btnStart.GetComponent<Image>().sprite = spriteDict["Untagged"];
|
||||
btnStart.tag = "Untagged";
|
||||
}
|
||||
|
||||
private void Save()
|
||||
private bool SaveFunc(RowerRecordModel model, List<string> files)
|
||||
{
|
||||
if (Application.internetReachability == NetworkReachability.NotReachable)
|
||||
{
|
||||
transform.Find("Stopped").gameObject.SetActive(true);
|
||||
Utils.showToast(null, App.GetLocalString("Please check the network status!"));
|
||||
tempRecordData = new TempRecordData(model, files);
|
||||
return false;
|
||||
}
|
||||
var res = ConfigHelper.rowerApi.Add(model, files);
|
||||
if (res.result)
|
||||
{
|
||||
UIManager.ShowRowerWelldone(model.Id, Init);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.errMsg);
|
||||
}
|
||||
tempRecordData = null;
|
||||
return true;
|
||||
}
|
||||
public class TempRecordData
|
||||
{
|
||||
public RowerRecordModel model;
|
||||
public List<string> files;
|
||||
public TempRecordData(RowerRecordModel model, List<string> files)
|
||||
{
|
||||
this.model = model;
|
||||
this.files = files;
|
||||
}
|
||||
}
|
||||
TempRecordData tempRecordData;
|
||||
private bool Save()
|
||||
{
|
||||
createTime = UIManager.Now.GetDateTime();
|
||||
var bleDevice = App.MainDeviceAdapter.GetDevices().FirstOrDefault(d => (d.State == DeviceState.Connected || d.State == DeviceState.Connecting) && d.Sensor == SensorType.Rower) as BleDevice;
|
||||
@@ -482,20 +572,13 @@ public class RowerHomeScript : PFUIPanel
|
||||
Helper.DelectDir(path);
|
||||
Debug.Log(ex.Message);
|
||||
}
|
||||
var res = ConfigHelper.rowerApi.Add(model, files);
|
||||
if (res.result)
|
||||
{
|
||||
UIManager.ShowRowerWelldone(model.Id);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.showToast(null, res.errMsg);
|
||||
}
|
||||
return SaveFunc(model, files);
|
||||
//Disconnect();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
print("初始化");
|
||||
if (RowerData != null)
|
||||
{
|
||||
RowerData.Reset();
|
||||
@@ -536,9 +619,7 @@ public class RowerHomeScript : PFUIPanel
|
||||
}
|
||||
|
||||
mid.Find("W/Value").GetComponent<Text>().text = "---";
|
||||
//bottom.Find("W/AvgValue").GetComponent<Text>().text = "---";
|
||||
bottom.Find("500/Value").GetComponent<Text>().text = "---";
|
||||
//bottom.Find("500/AvgValue").GetComponent<Text>().text = "---";
|
||||
bottom.Find("MS/Value").GetComponent<Text>().text = "---";
|
||||
//bottom.Find("MS/AvgValue").GetComponent<Text>().text = "---";
|
||||
bottom.Find("BPM/Value").GetComponent<Text>().text = "---";
|
||||
@@ -674,11 +755,8 @@ public class RowerHomeScript : PFUIPanel
|
||||
bottom.Find("Time/Value").GetComponent<Text>().text = TimeSpan.FromSeconds(++seconds).ToPFString();
|
||||
}
|
||||
mid.Find("W/Value").GetComponent<Text>().text = "---";
|
||||
//bottom.Find("W/AvgValue").GetComponent<Text>().text = "---";
|
||||
bottom.Find("500/Value").GetComponent<Text>().text = "---";
|
||||
//bottom.Find("500/AvgValue").GetComponent<Text>().text = "---";
|
||||
bottom.Find("MS/Value").GetComponent<Text>().text = "---";
|
||||
//bottom.Find("MS/AvgValue").GetComponent<Text>().text = "---";
|
||||
bottom.Find("Expected/Value").GetComponent<Text>().text = "---";
|
||||
records.Add($"{strokeCount},{RowerData.ElapsedTime},{distance},0,0,0,{RowerData.ResistanceLevel},{heartRate},{energy}");
|
||||
tmpdata = new TempRowerCalc() { strokeCount = strokeCount, pace = 0, power = 0, rate = 0, heartRate = heartRate, distance = distance, energy = energy };
|
||||
@@ -879,7 +957,7 @@ public class RowerHomeScript : PFUIPanel
|
||||
// x += 0.1f;
|
||||
//}
|
||||
}
|
||||
float staticTimer = 1f;
|
||||
float staticTimer = 1f,shortTimer = 0.1f;
|
||||
void Update()
|
||||
{
|
||||
if (openTimer)
|
||||
@@ -898,6 +976,31 @@ public class RowerHomeScript : PFUIPanel
|
||||
HandleStatic();
|
||||
staticTimer += 1f;
|
||||
}
|
||||
|
||||
shortTimer -= Time.deltaTime;
|
||||
if (shortTimer <= 0)
|
||||
{
|
||||
if (openTimer)
|
||||
{
|
||||
ShortUpdateData();
|
||||
}
|
||||
shortTimer += 0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
void ShortUpdateData()
|
||||
{
|
||||
if (RowerData == null) return;
|
||||
var power = RowerData.InstantaneousPower;
|
||||
var rate = RowerData.StrokeRate;
|
||||
var pace = RowerData.InstantaneousPace;
|
||||
if (stopSeconds >= 2)
|
||||
{
|
||||
return;
|
||||
}
|
||||
mid.Find("W/Value").GetComponent<Text>().text = power.ToString();
|
||||
bottom.Find("500/Value").GetComponent<Text>().text = TimeSpan.FromSeconds(pace).ToPFString();
|
||||
bottom.Find("MS/Value").GetComponent<Text>().text = rate.ToString();
|
||||
}
|
||||
void HandleStatic()
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Linq;
|
||||
using UnityEngine.UI;
|
||||
using Assets.Scripts.UI.Prefab.Login;
|
||||
using Newtonsoft.Json;
|
||||
using Assets.Scripts.UI.UIEffect;
|
||||
|
||||
public class RowerMultiModeScript : MonoBehaviour
|
||||
{
|
||||
@@ -176,8 +177,10 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
{
|
||||
this.rowerType = rowerType;
|
||||
currentSecond = -1;
|
||||
//if(Application.internetReachability == NetworkReachability.NotReachable)
|
||||
var res = reRowData ==null? await ConfigHelper.rowerApi.GetShadowList(rowerType): await ConfigHelper.rowerApi.GetReRowShadowList(reRowData.Id);
|
||||
shadowList = res.data;
|
||||
|
||||
//foreach (var t in traceList)
|
||||
//{
|
||||
// t.userId = 0;
|
||||
@@ -213,6 +216,16 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
DisplayUserRanks(true);
|
||||
DisplayTraces(true);
|
||||
}
|
||||
float GetStrokeSpeed(uint rate)
|
||||
{
|
||||
//0 10 20 30 35
|
||||
//0.9 0.8 0.7 0.6 0.5
|
||||
if (rate < 10) return 0.9f;
|
||||
else if (rate < 20) return 0.7f;
|
||||
else if (rate < 30) return 0.5f;
|
||||
else if (rate < 35) return 0.4f;
|
||||
else return 0.3f;
|
||||
}
|
||||
private void DisplayTrace(Transform t,TraceData data,TraceData mineData,bool isAni = false)
|
||||
{
|
||||
if (string.IsNullOrEmpty(data.Avatar))
|
||||
@@ -320,6 +333,11 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
if (isAni)
|
||||
{
|
||||
t.Find("Main/Boat").DOLocalMoveX(21.5f + tWidth, 0.6f);
|
||||
var rowed = t.Find("Main/Rowed").GetComponent<RectTransform>();
|
||||
rowed.GetComponent<UIGradient>().color1 = data.isMine ? Utils.HexToColorHtml("#f9308633") : Utils.HexToColorHtml("#27bac033");
|
||||
rowed.GetComponent<UIGradient>().color2 = data.isMine ? Utils.HexToColorHtml("#f930864d") : Utils.HexToColorHtml("#27bac04d");
|
||||
rowed.Find("Rank").GetComponent<Text>().text = (userList.FindIndex(x => x.UserId == data.UserId) + 1).ToString("00");
|
||||
rowed.DOSizeDelta(new Vector2(tWidth, rowed.sizeDelta.y), 0.6f);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -335,15 +353,16 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
{
|
||||
var ani = DOTween.Sequence();
|
||||
var _d = data.list[currentSecond];
|
||||
if (currentSecond > 0 && _d.Pace > 0)
|
||||
if (currentSecond > 0 && _d.Rate > 0)
|
||||
{
|
||||
var spDict = GetComponent<RowerHomeScript>().spriteDict;
|
||||
var spDict = data.isMine?GetComponent<RowerHomeScript>().spriteDict2: GetComponent<RowerHomeScript>().spriteDict;
|
||||
int spDictIndex = 0;
|
||||
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.2f));
|
||||
|
||||
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.3f));
|
||||
ani.AppendCallback(() =>
|
||||
{
|
||||
int spDictIndex2 = 14;
|
||||
DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.4f);
|
||||
DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.6f);
|
||||
});
|
||||
ani.Play();
|
||||
//var _pred = data.list[currentSecond - 1];
|
||||
@@ -414,13 +433,15 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
{
|
||||
var list = userList;
|
||||
var listc = transform.Find("Rower/Modes/Scroll/M2/Track/Container/List");
|
||||
print(listc.localPosition.ToString());
|
||||
var mineData = list.FirstOrDefault(x => x.isMine);
|
||||
var sindex = getStartIndexByMineData();
|
||||
int i = 0;
|
||||
if (isRefresh)
|
||||
{
|
||||
traceList.Clear();
|
||||
listc.localPosition = new Vector3(0, 115.5f);
|
||||
listc.GetComponent<RectTransform>().sizeDelta = new Vector2(550f, 43 + 47 * (list.Count - 1));
|
||||
print(listc.localPosition.ToString());
|
||||
listc.DestroyChildren();
|
||||
for (i = 0; i < list.Count; i++)
|
||||
{
|
||||
@@ -428,14 +449,14 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
var g = Instantiate<GameObject>(trace);
|
||||
g.name = i.ToString();
|
||||
DisplayTrace(g.transform.Find("T1/p1"), data, mineData);
|
||||
g.transform.SetParent(listc);
|
||||
g.transform.parent = listc;
|
||||
g.SetActive(true);
|
||||
g.transform.localScale = Vector3.one;
|
||||
g.transform.localPosition = new Vector3(0, -21.5f - 47f * i);
|
||||
print($"{i},{g.transform.localPosition}");
|
||||
//g.transform.Find("T1/p1").GetComponent<Image>().color = RandomColor();
|
||||
traceList.Add(new Trace { userId = data.UserId, trace = g.transform.Find("T1") });
|
||||
}
|
||||
listc.GetComponent<RectTransform>().sizeDelta = new Vector2(550f, 43 + 47 * (list.Count - 1));
|
||||
listc.DOLocalMoveY(47 * sindex + 115.5f, 0.8f);
|
||||
return;
|
||||
}
|
||||
@@ -464,11 +485,13 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
|
||||
sq.Join(t.parent.DOLocalMoveY(-47 * (diff.rank - 1) - 21.5f, 1.5f));
|
||||
var sq1 = DOTween.Sequence();
|
||||
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(0.2f, 0.75f));
|
||||
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(1f, 0.75f));
|
||||
//sq1.SetEase(Ease.InOutCubic);
|
||||
if (diff.sumdiff < 0)
|
||||
{
|
||||
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(0.2f, 0.75f));
|
||||
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(1f, 0.75f));
|
||||
}
|
||||
sq.Join(sq1);
|
||||
sq.SetEase(Ease.InOutCubic);
|
||||
//sq.SetEase(Ease.InOutCubic);
|
||||
//sq.Append(t.GetComponent)
|
||||
}
|
||||
//t.parent.name = i.ToString();
|
||||
@@ -1003,7 +1026,7 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
void Update()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
//return;
|
||||
return;
|
||||
timer -= Time.deltaTime;
|
||||
if (timer < 0)
|
||||
{
|
||||
@@ -1014,6 +1037,7 @@ public class RowerMultiModeScript : MonoBehaviour
|
||||
HandleTimeTick(new RowerChartModel()
|
||||
{
|
||||
Distance = 15,
|
||||
Rate = 35,
|
||||
});
|
||||
timer += 1f;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class RowerWelldone : PFUIPanel
|
||||
GameObject AllRecord, Record,Rank;
|
||||
Dictionary<string, Texture> caches;
|
||||
Transform rankContent, gradeContent;
|
||||
private Action initFunc;
|
||||
|
||||
public string id { get; private set; }
|
||||
|
||||
@@ -32,14 +33,13 @@ public class RowerWelldone : PFUIPanel
|
||||
{
|
||||
UIManager.AddEvent(transform.Find("Container/BtnDefine").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
startTime = false;
|
||||
Close();
|
||||
CloseModal();
|
||||
//UIManager.ShowHomePanel();
|
||||
//UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("Container/BtnView").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
Close();
|
||||
CloseModal();
|
||||
Application.OpenURL($"{App.websiteDict[App.Host]}rower/record/{id}?Token={App.CurrentUser.cookie}");
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("Container/Share/Wx").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
||||
@@ -80,8 +80,7 @@ public class RowerWelldone : PFUIPanel
|
||||
remainTime--;
|
||||
if (remainTime == 0)
|
||||
{
|
||||
startTime = false;
|
||||
Close();
|
||||
CloseModal();
|
||||
return;
|
||||
}
|
||||
transform.Find("Container/BtnDefine/Text").GetComponent<Text>().text = $"{App.GetLocalString("DEFINE")}({remainTime.ToString("#0")})";
|
||||
@@ -93,10 +92,10 @@ public class RowerWelldone : PFUIPanel
|
||||
float timer = 1f, remainTime = 10f;
|
||||
bool startTime = false;
|
||||
RowerSegmentData data;
|
||||
public async void Initial(string id)
|
||||
public async void Initial(string id,Action init)
|
||||
{
|
||||
Debug.Log("Initial");
|
||||
if (string.IsNullOrEmpty(id)) return;
|
||||
this.initFunc = init;
|
||||
this.id = id;
|
||||
var res = await ConfigHelper.rowerApi.GetSegmentDataAndRanking(id);
|
||||
if (res.result)
|
||||
@@ -125,7 +124,7 @@ public class RowerWelldone : PFUIPanel
|
||||
game.transform.SetParent(rankContent);
|
||||
game.transform.localScale = Vector3.one;
|
||||
game.SetActive(true);
|
||||
if (item.UserId == App.CurrentUser.Id)
|
||||
if (new Guid(item.Id) == new Guid(id))
|
||||
{
|
||||
game.transform.Find("Content/Rank").GetComponent<Text>().color = Utils.HexToColorHtml("#f93086");
|
||||
game.transform.Find("Content/NickName").GetComponent<Text>().color = Utils.HexToColorHtml("#f93086");
|
||||
@@ -163,4 +162,14 @@ public class RowerWelldone : PFUIPanel
|
||||
transform.Find("Container/Left/MyRank").GetComponent<Text>().text = data.info.MyRank;
|
||||
transform.Find("Container/Right/Time").GetComponent<Text>().text = data.info.CreateTime;
|
||||
}
|
||||
|
||||
public void CloseModal()
|
||||
{
|
||||
startTime = false;
|
||||
if (initFunc != null)
|
||||
{
|
||||
initFunc.Invoke();
|
||||
}
|
||||
Close();
|
||||
}
|
||||
}
|
||||
@@ -292,13 +292,13 @@ public class UIManager : MonoBehaviour
|
||||
return this.GetPanelInstance("RowerWelldone", ref this.mRowerWelldone);
|
||||
}
|
||||
}
|
||||
public static void ShowRowerWelldone(string id)
|
||||
public static void ShowRowerWelldone(string id, Action init)
|
||||
{
|
||||
Debug.Log("進入welldone");
|
||||
UIManager.Show(UIManager.Instance.RowerWelldone, null, true);
|
||||
if (UIManager.Instance.RowerWelldone)
|
||||
{
|
||||
UIManager.Instance.RowerWelldone.Initial(id);
|
||||
UIManager.Instance.RowerWelldone.Initial(id,init);
|
||||
}
|
||||
}
|
||||
//结果页
|
||||
|
||||
Reference in new issue
Block a user