Merge remote-tracking branch 'origin/dev_ani3' into dev_cyp
This commit is contained in:
commit
bfa9f5f998
@ -59,6 +59,7 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: 2a0878e6d65232b4eb49c2aa886ab9da, type: 3}
|
m_Script: {fileID: 11500000, guid: 2a0878e6d65232b4eb49c2aa886ab9da, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
newNav: {fileID: 0}
|
||||||
--- !u!1 &2752224541465288006
|
--- !u!1 &2752224541465288006
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -411,7 +412,7 @@ MonoBehaviour:
|
|||||||
m_HorizontalOverflow: 0
|
m_HorizontalOverflow: 0
|
||||||
m_VerticalOverflow: 0
|
m_VerticalOverflow: 0
|
||||||
m_LineSpacing: 1
|
m_LineSpacing: 1
|
||||||
m_Text: Smart Trainer
|
m_Text:
|
||||||
--- !u!114 &2376164354960099470
|
--- !u!114 &2376164354960099470
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -1,18 +1,5 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!114 &6820942701388656379
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 600129134975741725}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: 954bbf32f326f684c90a328ec1db5ff9, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
mType: 2
|
|
||||||
--- !u!114 &2374286134688455127
|
--- !u!114 &2374286134688455127
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -56,19 +43,19 @@ MonoBehaviour:
|
|||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
--- !u!114 &6820942701245574145
|
--- !u!114 &6820942701388656379
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 600129135100964347}
|
m_GameObject: {fileID: 600129134975741725}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 954bbf32f326f684c90a328ec1db5ff9, type: 3}
|
m_Script: {fileID: 11500000, guid: 954bbf32f326f684c90a328ec1db5ff9, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
mType: 8
|
mType: 2
|
||||||
--- !u!114 &619076547355285759
|
--- !u!114 &619076547355285759
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -112,6 +99,19 @@ MonoBehaviour:
|
|||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
|
--- !u!114 &6820942701245574145
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 600129135100964347}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 954bbf32f326f684c90a328ec1db5ff9, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
mType: 8
|
||||||
--- !u!1 &6820942700051256070
|
--- !u!1 &6820942700051256070
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1682,7 +1682,7 @@ PrefabInstance:
|
|||||||
- target: {fileID: 7414013380646078914, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
- target: {fileID: 7414013380646078914, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_AnchoredPosition.y
|
propertyPath: m_AnchoredPosition.y
|
||||||
value: -51
|
value: -57
|
||||||
objectReference: {fileID: 0}
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 7509276603553944008, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
- target: {fileID: 7509276603553944008, guid: 95d5b69c6ebb5f34bb864b2c0756d442,
|
||||||
type: 3}
|
type: 3}
|
||||||
|
|||||||
@ -205,7 +205,7 @@
|
|||||||
"Cadence Sensor": "踏频",
|
"Cadence Sensor": "踏频",
|
||||||
"Speed Meter": "速度计",
|
"Speed Meter": "速度计",
|
||||||
"Heart Rate Monitor": "心率带",
|
"Heart Rate Monitor": "心率带",
|
||||||
"NO DEVICE": "无可用设备",
|
"NO DEVICE": "尚未连接设备",
|
||||||
"Edit": "编辑",
|
"Edit": "编辑",
|
||||||
"Record": "记录",
|
"Record": "记录",
|
||||||
"More": "更多",
|
"More": "更多",
|
||||||
|
|||||||
@ -23,6 +23,22 @@ public static class PFConstants
|
|||||||
return Application.persistentDataPath + "/RowerRecords/";
|
return Application.persistentDataPath + "/RowerRecords/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 划船机训练保存在本地的路径
|
||||||
|
/// </summary>
|
||||||
|
public static string RowerRecordCacheFolder
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(Application.persistentDataPath + "/RowerRecordCaches/"))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(Application.persistentDataPath + "/RowerRecordCaches/");
|
||||||
|
}
|
||||||
|
|
||||||
|
return Application.persistentDataPath + "/RowerRecordCaches/";
|
||||||
|
}
|
||||||
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 课程训练保存在本地的路径
|
/// 课程训练保存在本地的路径
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -202,27 +202,6 @@ public class ConnectDeviceModal : PFUIPanel
|
|||||||
UIManager.AddEvent(deviceItemObj.gameObject, EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction<BaseEventData>(e =>
|
UIManager.AddEvent(deviceItemObj.gameObject, EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction<BaseEventData>(e =>
|
||||||
{
|
{
|
||||||
deviceItemObj.Set(true);
|
deviceItemObj.Set(true);
|
||||||
|
|
||||||
var trainer = SensorType == SensorType.Trainer && deviceItemObj.DeviceInfo.State == DeviceState.Connected;
|
|
||||||
var nontrainer = deviceItemObj.DeviceInfo.Sensor != SensorType.Trainer && SensorType != SensorType.Trainer && deviceItemObj.DeviceInfo.State == DeviceState.Connected;
|
|
||||||
if (trainer || nontrainer)
|
|
||||||
{
|
|
||||||
connectBtnText.text = App.GetLocalString("DISCONNECT");
|
|
||||||
connectBtnText.GetComponent<PFUIText>().key = "DISCONNECT";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
connectBtnText.text = App.GetLocalString("CONNECT");
|
|
||||||
connectBtnText.GetComponent<PFUIText>().key = "CONNECT";
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in deviceList)
|
|
||||||
{
|
|
||||||
if (item.Key != deviceItemObj.DeviceInfo.Id)
|
|
||||||
{
|
|
||||||
item.Value.Set(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
//UIManager.AddEvent(deviceItemObj.gameObject, EventTriggerType.Deselect, new UnityEngine.Events.UnityAction<BaseEventData>(e =>
|
//UIManager.AddEvent(deviceItemObj.gameObject, EventTriggerType.Deselect, new UnityEngine.Events.UnityAction<BaseEventData>(e =>
|
||||||
@ -259,6 +238,14 @@ public class ConnectDeviceModal : PFUIPanel
|
|||||||
//connectBtn.text.text = "DISCOUNECT";
|
//connectBtn.text.text = "DISCOUNECT";
|
||||||
noDevice.text = firstDevice.DeviceInfo.Name;
|
noDevice.text = firstDevice.DeviceInfo.Name;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var defaultDevice = deviceList.FirstOrDefault();
|
||||||
|
if (defaultDevice.Value != null)
|
||||||
|
{
|
||||||
|
defaultDevice.Value.Set(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
//DeviceItem firstDevice;
|
//DeviceItem firstDevice;
|
||||||
//var devicesTemp = deviceList.Select(d => d.Value).Where(d => d.DeviceInfo.State == DeviceState.Connected);
|
//var devicesTemp = deviceList.Select(d => d.Value).Where(d => d.DeviceInfo.State == DeviceState.Connected);
|
||||||
//if(SensorType == SensorType.Cadence || SensorType == SensorType.SpeedCadence)
|
//if(SensorType == SensorType.Cadence || SensorType == SensorType.SpeedCadence)
|
||||||
@ -268,6 +255,30 @@ public class ConnectDeviceModal : PFUIPanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//选中需要连接的设备
|
||||||
|
public void SelectDevice(DeviceItem deviceItemObj)
|
||||||
|
{
|
||||||
|
var trainer = SensorType == SensorType.Trainer && deviceItemObj.DeviceInfo.State == DeviceState.Connected;
|
||||||
|
var nontrainer = deviceItemObj.DeviceInfo.Sensor != SensorType.Trainer && SensorType != SensorType.Trainer && deviceItemObj.DeviceInfo.State == DeviceState.Connected;
|
||||||
|
if (trainer || nontrainer)
|
||||||
|
{
|
||||||
|
connectBtnText.text = App.GetLocalString("DISCONNECT");
|
||||||
|
connectBtnText.GetComponent<PFUIText>().key = "DISCONNECT";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
connectBtnText.text = App.GetLocalString("CONNECT");
|
||||||
|
connectBtnText.GetComponent<PFUIText>().key = "CONNECT";
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in deviceList)
|
||||||
|
{
|
||||||
|
if (item.Key != deviceItemObj.DeviceInfo.Id)
|
||||||
|
{
|
||||||
|
item.Value.Set(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public override void Show()
|
public override void Show()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -153,6 +153,8 @@ public class DeviceItem : Selectable, IEventSystemHandler, IPointerClickHandler
|
|||||||
if (this.isOn)
|
if (this.isOn)
|
||||||
{
|
{
|
||||||
SetSelectedStyle();
|
SetSelectedStyle();
|
||||||
|
var manager = FindObjectOfType<ConnectDeviceModal>();
|
||||||
|
manager.SelectDevice(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -137,7 +137,10 @@ public class DeviceView : MonoBehaviour
|
|||||||
connectButtonClick();
|
connectButtonClick();
|
||||||
}));
|
}));
|
||||||
#endif
|
#endif
|
||||||
|
UIManager.AddEvent(mSearchButton, EventTriggerType.PointerClick, new UnityAction<UnityEngine.EventSystems.BaseEventData>(e =>
|
||||||
|
{
|
||||||
|
connectButtonClick();
|
||||||
|
}));
|
||||||
UIManager.AddEvent(mPairButton, EventTriggerType.PointerClick, new UnityAction<UnityEngine.EventSystems.BaseEventData>(e =>
|
UIManager.AddEvent(mPairButton, EventTriggerType.PointerClick, new UnityAction<UnityEngine.EventSystems.BaseEventData>(e =>
|
||||||
{
|
{
|
||||||
connectButtonClick();
|
connectButtonClick();
|
||||||
|
|||||||
@ -869,7 +869,7 @@ public class RowerHomeScript : PFUIPanel
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var files = Directory.GetFiles(PFConstants.RowerRecordFolder);
|
var files = Directory.GetFiles(PFConstants.RowerRecordCacheFolder);
|
||||||
if (files.Length > 0)
|
if (files.Length > 0)
|
||||||
{
|
{
|
||||||
UIManager.ShowConfirm(App.GetLocalString("Warn"), App.GetLocalString("continue a game?"), () =>
|
UIManager.ShowConfirm(App.GetLocalString("Warn"), App.GetLocalString("continue a game?"), () =>
|
||||||
@ -916,7 +916,7 @@ public class RowerHomeScript : PFUIPanel
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var path = $"{PFConstants.RowerRecordFolder}/{Id}.txt";
|
var path = $"{PFConstants.RowerRecordCacheFolder}/{Id}.txt";
|
||||||
File.WriteAllText(path, string.Join("\r\n", records));
|
File.WriteAllText(path, string.Join("\r\n", records));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|||||||
@ -67,7 +67,7 @@ public class RowerDeviceView : MonoBehaviour
|
|||||||
mSearchButton = unconnectionPanel.transform.Find("SearchButton").gameObject;
|
mSearchButton = unconnectionPanel.transform.Find("SearchButton").gameObject;
|
||||||
mPairButton = unconnectionPanel.transform.Find("PairButton").gameObject;
|
mPairButton = unconnectionPanel.transform.Find("PairButton").gameObject;
|
||||||
searchState = unconnectionPanel.transform.Find("SearchState").GetComponent<Text>();
|
searchState = unconnectionPanel.transform.Find("SearchState").GetComponent<Text>();
|
||||||
mPairButton.SetActive(false);
|
//mPairButton.SetActive(false);
|
||||||
connectionPanel = this.transform.Find("ConnectionPanel").gameObject;
|
connectionPanel = this.transform.Find("ConnectionPanel").gameObject;
|
||||||
|
|
||||||
var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||||
@ -278,7 +278,7 @@ public class RowerDeviceView : MonoBehaviour
|
|||||||
#if !(UNITY_IOS || UNITY_ANDROID)
|
#if !(UNITY_IOS || UNITY_ANDROID)
|
||||||
mSearchButton.SetActive(true);
|
mSearchButton.SetActive(true);
|
||||||
#endif
|
#endif
|
||||||
mPairButton.SetActive(false);
|
//mPairButton.SetActive(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(connectedDevice.State == DeviceState.Connecting)
|
else if(connectedDevice.State == DeviceState.Connecting)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user