Merge branch 'dev_rower' into dev_cyp

# Conflicts:
#	ProjectSettings/ProjectSettings.asset
This commit is contained in:
Caiyanpeng committed 2022-03-09 09:12:42 +08:00
commit e6f3e2ecfa
10 files changed
+2371 -1638

No files matched your search

+8 -5
View File
@@ -64,7 +64,7 @@ public class NewMainNav : MonoBehaviour
SetExpand(false);
}
/// <summary>
/// true:展开 false:关闭
/// </summary>
@@ -77,7 +77,7 @@ public class NewMainNav : MonoBehaviour
types = typeArray.Where((x, i) => indexs.Contains(i)).ToList();
}
string shrinkName = null;
if (shrinkIndex.HasValue && (shrinkIndex == 0 || shrinkIndex == 2))
if (shrinkIndex.HasValue && isShrinkIndex(shrinkIndex.Value))
{
shrinkName = typeArray[shrinkIndex.Value];
}
@@ -117,7 +117,7 @@ public class NewMainNav : MonoBehaviour
public void ShowButton(string v)
{
var i = typeArray.FindIndex((x)=>x == v);
if (i == -1 || i == 0 || i == 2)
if (i == -1 || isShrinkIndex(i))
{
return;
}
@@ -127,7 +127,7 @@ public class NewMainNav : MonoBehaviour
public void HideButton(string v)
{
var i = typeArray.FindIndex((x) => x == v);
if (i == -1 || i == 0 || i == 2)
if (i == -1 || isShrinkIndex(i))
{
return;
}
@@ -245,7 +245,10 @@ public class NewMainNav : MonoBehaviour
transform.Find("Home").gameObject.SetActive(false);
}
}
private bool isShrinkIndex(int ind)
{
return ind == 0 || ind == 2;
}
// Start is called before the first frame update
void Start()
{
@@ -42,7 +42,10 @@ public class HomeController : PFUIPanel
#if UNITY_ANDROID || UNITY_IOS
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 });
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 },null,new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Rower/划船"), () =>
{
UIManager.ShowRowerPanel();
}));
newNav = nav;
UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b =>
{
@@ -93,6 +93,14 @@ public class RowerHomeScript : PFUIPanel
/// </summary>
int stopSeconds = 0;
uint totalDistance = 0;
protected override void Start()
{
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
nav.SetButtonActive(new List<int> {1,4,6 }, null, new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/Rower/骑行"), () =>
{
ReturnHome();
}));
}
protected override void Awake()
{
spriteDict = new Dictionary<object, Sprite>()
@@ -127,6 +135,15 @@ public class RowerHomeScript : PFUIPanel
left = transform.Find("Left");
bottom = transform.Find("Bottom");
PaintPullCurveDelegate = new EventHandler(PaintPullCurve);
transform.Find("PFUISlider").GetComponent<PFUISlider>().SetValueChanged(r =>
{
var v = (ushort)(r * 65535);
if (Rower != null)
{
Rower.SetResistanceLevel(v);
//RowerData.
}
});
Init();
}