This commit is contained in:
CaiYanPeng 2021-08-25 14:32:49 +08:00
parent 88beff5b89
commit 89e3a04fe9
12 changed files with 4974 additions and 1577 deletions

View File

@ -1,19 +1,21 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" /> <application>
<application android:theme="@style/UnityThemeSelector" android:icon="@drawable/app_icon" android:label="@string/app_name" android:isGame="true"> <activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector" >
<activity android:label="@string/app_name" android:screenOrientation="fullSensor" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false" android:name="com.unity3d.player.UnityPlayerActivity"> <intent-filter>
<intent-filter> <action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LAUNCHER" /> </intent-filter>
<category android:name="android.intent.category.LEANBACK_LAUNCHER" /> <intent-filter>
<data android:scheme="powerfunx" android:host="app" /> <action android:name="android.intent.action.VIEW" />
</intent-filter> <category android:name="android.intent.category.DEFAULT" />
<meta-data android:name="unityplayer.UnityActivity" android:value="true" /> <category android:name="android.intent.category.BROWSABLE" />
</activity> <data android:scheme="powerfunx" android:host="app" />
</application> </intent-filter>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> </activity>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> </application>
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
</manifest> <uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-feature android:name="android.hardware.bluetooth_le" android:required="false"/>
</manifest>

View File

@ -224,9 +224,9 @@ RectTransform:
m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: m_Children:
- {fileID: 1079225629459415319}
- {fileID: 3931130817493022313} - {fileID: 3931130817493022313}
- {fileID: 4277467338018245799} - {fileID: 4277467338018245799}
- {fileID: 1079225629459415319}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -499,7 +499,7 @@ RectTransform:
- {fileID: 4007984775395188520} - {fileID: 4007984775395188520}
- {fileID: 4160894300255257250} - {fileID: 4160894300255257250}
m_Father: {fileID: 1777885814862178517} m_Father: {fileID: 1777885814862178517}
m_RootOrder: 1 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
@ -1073,7 +1073,7 @@ PrefabInstance:
- target: {fileID: 2589794478191162465, guid: 652cdefe0475dfd429e5a7e92bc3fa31, - target: {fileID: 2589794478191162465, guid: 652cdefe0475dfd429e5a7e92bc3fa31,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 2 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2589794478191162465, guid: 652cdefe0475dfd429e5a7e92bc3fa31, - target: {fileID: 2589794478191162465, guid: 652cdefe0475dfd429e5a7e92bc3fa31,
type: 3} type: 3}
@ -1519,7 +1519,7 @@ PrefabInstance:
- target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e, - target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e,
type: 3} type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 0 value: 2
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e, - target: {fileID: 2638424933752433027, guid: a1999d0576fee6248a9c5a507ae8d10e,
type: 3} 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_Father: {fileID: 273807004}
m_RootOrder: 2 m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0.5, y: 0.5} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0} 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} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1985738407 --- !u!114 &1985738407
MonoBehaviour: 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 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; public static string AppVersion = Application.version;

View File

@ -22,7 +22,7 @@ public class MainController : BaseScene
DeviceCache.Init(PFConstants.DeviceCacheFolder); DeviceCache.Init(PFConstants.DeviceCacheFolder);
Loom.Initialize(); Loom.Initialize();
#if UNITY_ANDROID || UNITY_IOS #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("Panel").GetComponent<RectTransform>().sizeDelta = new Vector2(844, 390);
#endif #endif
App.MainDeviceAdapter.StartScan(); App.MainDeviceAdapter.StartScan();

View File

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

View File

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

View File

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

View File

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