Merge remote-tracking branch 'origin/dev_mobile' into dev_mobile_ble

This commit is contained in:
lishuo 2021-08-25 16:09:18 +08:00
commit 0139cbc173
11 changed files with 4954 additions and 1559 deletions

View File

@ -224,9 +224,9 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1079225629459415319}
- {fileID: 3931130817493022313}
- {fileID: 4277467338018245799}
- {fileID: 1079225629459415319}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -499,7 +499,7 @@ RectTransform:
- {fileID: 4007984775395188520}
- {fileID: 4160894300255257250}
m_Father: {fileID: 1777885814862178517}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -1073,7 +1073,7 @@ PrefabInstance:
- target: {fileID: 2589794478191162465, guid: 652cdefe0475dfd429e5a7e92bc3fa31,
type: 3}
propertyPath: m_RootOrder
value: 2
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2589794478191162465, guid: 652cdefe0475dfd429e5a7e92bc3fa31,
type: 3}
@ -1519,7 +1519,7 @@ PrefabInstance:
- target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e,
type: 3}
propertyPath: m_RootOrder
value: 0
value: 2
objectReference: {fileID: 0}
- target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e,
type: 3}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -831,10 +831,10 @@ RectTransform:
m_Father: {fileID: 273807004}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 1600, y: 900}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1985738407
MonoBehaviour:

File diff suppressed because it is too large Load Diff

View File

@ -11,7 +11,7 @@ using Assets.Scripts.Devices;
public static class App
{
public static string Host = "http://192.168.0.101:5083/";
public static string Host = "http://192.168.0.101:5084/";
public static string AppVersion = Application.version;

View File

@ -22,7 +22,7 @@ public class MainController : BaseScene
DeviceCache.Init(PFConstants.DeviceCacheFolder);
Loom.Initialize();
#if UNITY_ANDROID || UNITY_IOS
transform.GetComponent<CanvasScaler>().referenceResolution = new Vector2(844,390);
transform.GetComponent<CanvasScaler>().referenceResolution = new Vector2(844, 390);
transform.Find("Panel").GetComponent<RectTransform>().sizeDelta = new Vector2(844, 390);
transform.Find("ModalPanel").GetComponent<RectTransform>().sizeDelta = new Vector2(844, 390);
#endif

View File

@ -88,7 +88,8 @@ public class QuickLoginScroll : MonoBehaviour
}
void goLeft()
{
if (scroll.horizontalNormalizedPosition <= contentSize) return;
Debug.Log($"{scroll.horizontalNormalizedPosition},{contentSize}");
if (scroll.horizontalNormalizedPosition+0.0001 <= contentSize) return;
goMove(-1);
}
void goRight()
@ -113,6 +114,10 @@ public class QuickLoginScroll : MonoBehaviour
(scroll.horizontalNormalizedPosition + (contentSize / 2)) / contentSize,
0);
#else
if (contentSize == 0)
{
return 1;
}
return (int)System.Math.Round(
(scroll.horizontalNormalizedPosition+ contentSize) / contentSize,
0);

View File

@ -93,7 +93,11 @@ public class HomeController : PFUIPanel
}
private void GoRide(BaseEventData e)
{
Debug.Log(App.firstEnter.ToString());
//UIManager.ShowEarthPanel(App.latitude, App.longitude);
#if UNITY_ANDROID || UNITY_IOS
UIManager.ShowMapListPanel();
#else
if (App.firstEnter == 0)
{
App.firstEnter = 1;
@ -103,6 +107,8 @@ public class HomeController : PFUIPanel
{
UIManager.ShowMapListPanel();
}
#endif
OnExit(e);
}
void goTraining(BaseEventData e)

View File

@ -12,10 +12,9 @@ public class UserInfoController : PFUIPanel
// Start is called before the first frame update
UserApi userApi;
Transform infoPanel,summaryPanel;
protected override void Awake()
protected override void Start()
{
this.transform.localPosition = new Vector3(0, 0, 0);
Button exitBtn = this.transform.Find("InfoPanel").Find("Button").GetComponent<Button>();
UIManager.AddEvent(exitBtn.gameObject, EventTriggerType.PointerClick, (b) =>
@ -55,6 +54,14 @@ public class UserInfoController : PFUIPanel
//{
// UIManager.ShowEditUserPanel();
//});
#if UNITY_ANDROID || UNITY_IOS
editBtn.gameObject.SetActive(true);
var recordBtn = infoPanel.Find("RecordButton");
UIManager.AddEvent(recordBtn.gameObject, EventTriggerType.PointerEnter, (b) =>
{
Debug.Log("去看記錄");
});
#else
UIManager.AddEvent(transform.Find("InfoPanel").gameObject, EventTriggerType.PointerEnter, (b) =>
{
editBtn.gameObject.SetActive(true);
@ -63,23 +70,28 @@ public class UserInfoController : PFUIPanel
{
editBtn.gameObject.SetActive(false);
});
#endif
summaryPanel = transform.Find("SummaryPanel");
//创建比赛
#if !(UNITY_ANDROID || UNITY_IOS)
var createBtn = summaryPanel.Find("CreateBtn").gameObject;
UIManager.AddEvent(createBtn, EventTriggerType.PointerClick, (b) =>
{
Application.OpenURL(App.CurrentUser.WebHost + "Mine/EditMatch?Token=" + App.CurrentUser.cookie);
});
#endif
}
public override void Show()
{
base.Show();
Load();
#if !(UNITY_ANDROID || UNITY_IOS)
if (summaryPanel != null)
{
summaryPanel.Find("Panel").Find("RideResultList").GetComponent<ResultListController>().Load();
}
#endif
}
async void Load()
{
@ -104,6 +116,18 @@ public class UserInfoController : PFUIPanel
infoPanel.Find("NameText").GetComponent<Text>().text = $"{user.Nickname}";
infoPanel.Find("EmailText").GetComponent<Text>().text = $"{user.Phone}";
infoPanel.Find("DescText").GetComponent<Text>().text = $"{summary.Tips}";
#if UNITY_IOS || UNITY_ANDROID
infoPanel.Find("Container/Ftp").Find("Value").GetComponent<Text>().text = user.FTP.ToString();
infoPanel.Find("Container/MHR").Find("Value").GetComponent<Text>().text = user.MaxHeartRate.ToString();
infoPanel.Find("Container/Weight").Find("Value").GetComponent<Text>().text = $"{user.Weight}KG";
infoPanel.Find("Container/BW").Find("Value").GetComponent<Text>().text = $"{user.BicycleWeight}KG";
infoPanel.Find("Container/WD").Find("Value").GetComponent<Text>().text = $"{user.WheelDiameter}MM";
infoPanel.Find("Container/Ftp").Find("Time").GetComponent<Text>().text = user.LastUpdateFtpTime.ToString("dd-MM-yyyy");
infoPanel.Find("Container/Weight").Find("Time").GetComponent<Text>().text = user.LastUpdateWeightTime.ToString("dd-MM-yyyy");
infoPanel.Find("Container/BW").Find("Time").GetComponent<Text>().text = user.LastUpdateBicycleWeightTime.ToString("dd-MM-yyyy");
infoPanel.Find("Container/WD").Find("Time").GetComponent<Text>().text = user.LastUpdateWheelStraight.ToString("dd-MM-yyyy");
infoPanel.Find("Container/MHR").Find("Time").GetComponent<Text>().text = user.LastUpdateMaxHeartRate.ToString("dd-MM-yyyy");
#else
infoPanel.Find("Ftp").Find("Value").GetComponent<Text>().text = user.FTP.ToString();
infoPanel.Find("MHR").Find("Value").GetComponent<Text>().text = user.MaxHeartRate.ToString();
infoPanel.Find("Weight").Find("Value").GetComponent<Text>().text = $"{user.Weight}KG";
@ -114,6 +138,7 @@ public class UserInfoController : PFUIPanel
infoPanel.Find("BW").Find("Time").GetComponent<Text>().text = user.LastUpdateBicycleWeightTime.ToString("dd-MM-yyyy");
infoPanel.Find("WD").Find("Time").GetComponent<Text>().text = user.LastUpdateWheelStraight.ToString("dd-MM-yyyy");
infoPanel.Find("MHR").Find("Time").GetComponent<Text>().text = user.LastUpdateMaxHeartRate.ToString("dd-MM-yyyy");
#endif
if (user.Sex == 2)
{
infoPanel.Find("SexIcon").GetComponent<Image>().sprite = Resources.Load<Sprite>("Images/woman");
@ -127,7 +152,9 @@ public class UserInfoController : PFUIPanel
summaryPanel.Find("KM").Find("Value").GetComponent<Text>().text = summary.TotalDistance.ToString();
summaryPanel.Find("Climb").Find("Value").GetComponent<Text>().text = summary.TotalClimb.ToString();
summaryPanel.Find("Calories").Find("Value").GetComponent<Text>().text = summary.TotalKj.ToString();
#if !(UNITY_ANDROID || UNITY_IOS)
summaryPanel.Find("CreateBtn").gameObject.SetActive(user.CanCreateRace);
#endif
}
}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 1a70f37e2f13e4df0ac477f3c3eb451b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant: