合计修正版本暂存
This commit is contained in:
1 parent
769b75e2e2
commit
a2b44262f7
17 files changed
+5498
-314
No files matched your search
@@ -47,6 +47,7 @@ namespace Assets.Scripts.Apis
|
||||
return Get<JsonResult<MapRoute>>($"Map/GetMapRouteById?id={id}");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -184,5 +185,12 @@ namespace Assets.Scripts.Apis
|
||||
var result = await GetAsync<JsonResult<List<MapMaxRanking>>>($"Map/GetMaxRanking");
|
||||
return result;
|
||||
}
|
||||
|
||||
public async Task<JsonResult<List<MapRouteAreaItem>>> GetRecommendAreaList()
|
||||
{
|
||||
var result = await GetAsync<JsonResult<List<MapRouteAreaItem>>>($"MapRouteArea/GetRecommendAreaList");
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -194,7 +194,14 @@ public static class App
|
||||
TcpAddress = new IPEndPoint(IPAddress.Parse("192.168.0.102"), 21001);
|
||||
//Debug.unityLogger.logEnabled = false;
|
||||
#endif
|
||||
FB.Init();
|
||||
if (!FB.IsInitialized)
|
||||
{
|
||||
FB.Init();
|
||||
}
|
||||
else
|
||||
{
|
||||
FB.ActivateApp();
|
||||
}
|
||||
var isRower = PlayerPrefs.GetString("IsRowerMode");
|
||||
if (!string.IsNullOrEmpty(isRower))
|
||||
{
|
||||
|
||||
@@ -64,7 +64,7 @@ public class MainController : BaseScene
|
||||
FinishMessage(sender);
|
||||
}
|
||||
|
||||
CanvasGroup[] msgs;
|
||||
List<CanvasGroup> msgs;
|
||||
Vector3 msgLocation;
|
||||
int msgIndex = 0;
|
||||
CanvasGroup rightMessage;
|
||||
@@ -82,9 +82,10 @@ public class MainController : BaseScene
|
||||
msg3.transform.localPosition = 1 * msgLocation;
|
||||
msg3.transform.localScale = Vector3.one;
|
||||
msg3.alpha = 0;
|
||||
msgs = new CanvasGroup[] { msg, msg2, msg3 };
|
||||
msgs = List<CanvasGroup> { msg, msg2, msg3 };
|
||||
rightMessage = transform.Find("GameObject/MessageRight").GetComponent<CanvasGroup>();
|
||||
#else
|
||||
msgLocation = new Vector3(168, -153, 0);
|
||||
var go = transform.Find("GameObject");
|
||||
go.GetComponent<RectTransform>().anchorMin = Vector2.zero;
|
||||
go.GetComponent<RectTransform>().anchorMax = Vector2.one;
|
||||
@@ -97,7 +98,18 @@ public class MainController : BaseScene
|
||||
|
||||
rightMessage.transform.SetParent(go);
|
||||
rightMessage.transform.localScale = Vector3.one;
|
||||
rightMessage.transform.localPosition = new Vector3(-112, 164, 0);
|
||||
rightMessage.transform.localPosition = 1 * msgLocation;
|
||||
msgs = new List<CanvasGroup> { rightMessage };
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
var tmpm = Instantiate<CanvasGroup>(rightMessage);
|
||||
tmpm.transform.SetParent(rightMessage.transform.parent);
|
||||
tmpm.transform.localPosition = 1 * msgLocation;
|
||||
tmpm.transform.localScale = Vector3.one;
|
||||
tmpm.alpha = 0;
|
||||
msgs.Add(tmpm);
|
||||
}
|
||||
|
||||
Debug.Log(rightMessage.GetComponent<RectTransform>().localPosition);
|
||||
//rightMessage.transform.SetParent(transform.Find("GameObject"));
|
||||
#endif
|
||||
@@ -120,7 +132,7 @@ public class MainController : BaseScene
|
||||
#else
|
||||
if (App.currentPageIsHome)
|
||||
{
|
||||
DoMessageRight(e);
|
||||
DoMessage6(e);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -156,6 +168,38 @@ public class MainController : BaseScene
|
||||
}
|
||||
msgIndex++;
|
||||
}
|
||||
private void DoMessage6(LinkedMessageEvent e)
|
||||
{
|
||||
var selectIndex = msgIndex % 6;
|
||||
var m = msgs[selectIndex];
|
||||
if (msgIndex >= 6) //
|
||||
{
|
||||
//msgIndex = 0;
|
||||
m.DOFade(0, 0.5f).onComplete = () =>
|
||||
{
|
||||
SetMessage(m, e);
|
||||
m.transform.localPosition = 1 * msgLocation;
|
||||
m.DOFade(1, 0.5f);
|
||||
foreach (var item in msgs.Where((x, i) => i != selectIndex))
|
||||
{
|
||||
item.transform.DOLocalMoveY(item.transform.localPosition.y + 38, 0.5f);
|
||||
}
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log(191);
|
||||
SetMessage(m, e);
|
||||
for (int i = 0; i < msgIndex; i++)
|
||||
{
|
||||
var rect = msgs[i].GetComponent<RectTransform>();
|
||||
rect.DOLocalMoveY(rect.localPosition.y + 38, 0.5f);
|
||||
}
|
||||
m.DOFade(1, 0.5f);
|
||||
}
|
||||
msgIndex++;
|
||||
}
|
||||
|
||||
void FinishMessage(object sender)
|
||||
{
|
||||
#if UNITY_STANDALONE_WIN
|
||||
@@ -170,7 +214,7 @@ public class MainController : BaseScene
|
||||
#else
|
||||
if (!(bool)sender)
|
||||
{
|
||||
FinishMessageRight();
|
||||
FinishMessage6();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -193,6 +237,15 @@ public class MainController : BaseScene
|
||||
msgIndex = 0;
|
||||
rightMessage.DOFade(0, 0.3f);
|
||||
}
|
||||
void FinishMessage6()
|
||||
{
|
||||
msgIndex = 0;
|
||||
foreach (var m in msgs)
|
||||
{
|
||||
m.alpha = 0;
|
||||
m.GetComponent<RectTransform>().localPosition = 1 * msgLocation;
|
||||
}
|
||||
}
|
||||
private void SetMessage(CanvasGroup m,LinkedMessageEvent e)
|
||||
{
|
||||
m.transform.Find("Avatar").GetComponent<RawImage>().texture = null;
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
using Assets.Scripts.UI.Control;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class NewMainNav : MonoBehaviour
|
||||
{
|
||||
private GameObject exit;
|
||||
private GameObject home;
|
||||
private GameObject back;
|
||||
float delayTime = 0;
|
||||
private List<string> typeArray = new List<string>()
|
||||
{
|
||||
"Back","Exit","Home","Device","Delay","Setting","Support"
|
||||
};
|
||||
private List<int> indexs = new List<int>();
|
||||
/// <summary>
|
||||
/// 0,1,2,3,4,5,6
|
||||
/// "Back","Exit","Home","Device","Delay","Setting","Support"
|
||||
/// </summary>
|
||||
public void SetButtonActive(List<int> indexs)
|
||||
{
|
||||
this.indexs = indexs;
|
||||
SetExpand(false);
|
||||
//List<string> types = new List<string>();
|
||||
//if (indexs != null)
|
||||
//{
|
||||
// types = typeArray.Where((x, i) => indexs.Contains(i)).ToList();
|
||||
//}
|
||||
//foreach (Transform item in transform)
|
||||
//{
|
||||
// item.gameObject.SetActive(types.Contains(item.name));
|
||||
//}
|
||||
}
|
||||
/// <summary>
|
||||
/// true:展开 false:关闭
|
||||
/// </summary>
|
||||
/// <param name="flag"></param>
|
||||
private void SetExpand(bool flag)
|
||||
{
|
||||
List<string> types = new List<string>();
|
||||
if (indexs != null)
|
||||
{
|
||||
types = typeArray.Where((x, i) => indexs.Contains(i)).ToList();
|
||||
}
|
||||
foreach (Transform item in transform)
|
||||
{
|
||||
if (flag)
|
||||
{
|
||||
if (item.name == "Down")
|
||||
{
|
||||
item.gameObject.SetActive(true);
|
||||
}
|
||||
else if (item.name == "PF")
|
||||
{
|
||||
item.gameObject.SetActive(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.gameObject.SetActive(types.Contains(item.name));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
item.gameObject.SetActive(item.name == "PF");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
private void Awake()
|
||||
{
|
||||
UIManager.AddEvent(transform.Find("PF").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
SetExpand(true);
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("Down").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
SetExpand(false);
|
||||
});
|
||||
//var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||
|
||||
//var rect = ((RectTransform)this.transform).rect;
|
||||
//material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||
//this.GetComponent<Image>().material = material;
|
||||
|
||||
var device = this.transform.Find("Device");
|
||||
UIManager.AddEvent(device.gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
//Debug.Log("click device");
|
||||
UIManager.ShowDevicePanel();
|
||||
});
|
||||
|
||||
home = this.transform.Find("Home").gameObject;
|
||||
UIManager.AddEvent(home, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowHomePanel();
|
||||
});
|
||||
|
||||
exit = this.transform.Find("Exit").gameObject;
|
||||
exit.SetActive(false);
|
||||
back = transform.Find("Back").gameObject;
|
||||
back.SetActive(false);
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
UIManager.AddEvent(transform.Find("Delay").gameObject, EventTriggerType.PointerClick, b =>
|
||||
{
|
||||
delayTime = 3;
|
||||
transform.Find("Delay/Tooltips").gameObject.SetActive(true);
|
||||
transform.Find("Delay/Tooltips").GetComponent<CanvasGroup>().DOFade(1, 0.5f);
|
||||
});
|
||||
#endif
|
||||
//transform.Find("Delay").GetComponent<PfUIButton>().showTooltip = true;
|
||||
UIManager.AddEvent(exit, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", ()=> {
|
||||
Application.Quit();
|
||||
},2);
|
||||
});
|
||||
UIManager.AddEvent(back, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.ShowPrePanel();
|
||||
});
|
||||
|
||||
UIManager.AddEvent(transform.Find("Setting").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowSettingModal();
|
||||
});
|
||||
UIManager.AddEvent(transform.Find("Support").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowFeedBackModal();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void ShowRowerTab()
|
||||
{
|
||||
if (transform.Find("Device"))
|
||||
{
|
||||
transform.Find("Device").gameObject.SetActive(false);
|
||||
}
|
||||
if (transform.Find("Exit"))
|
||||
{
|
||||
transform.Find("Exit").gameObject.SetActive(true);
|
||||
}
|
||||
if (transform.Find("Home"))
|
||||
{
|
||||
transform.Find("Home").gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (delayTime < 0)
|
||||
{
|
||||
Debug.Log("小时");
|
||||
delayTime = 0;
|
||||
transform.Find("Delay/Tooltips").GetComponent<CanvasGroup>().DOFade(0, 0.5f).onComplete = ()=>
|
||||
{
|
||||
transform.Find("Delay/Tooltips").gameObject.SetActive(false);
|
||||
};
|
||||
}
|
||||
else if(delayTime > 0)
|
||||
{
|
||||
Debug.Log(delayTime);
|
||||
delayTime -= Time.deltaTime;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fca4162bdac783449b37ea751c075353
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -35,8 +35,13 @@ public class HomeController : PFUIPanel
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
#if UNITY_ANDROID || UNITY_IOS
|
||||
var nav = transform.Find("MainNav-mobile").GetComponent<NewMainNav>();
|
||||
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 });
|
||||
#else
|
||||
mainNav = this.transform.Find("MainNav").GetComponent<MainNav>();
|
||||
mainNav.ShowExit();
|
||||
#endif
|
||||
var BtnContainer = transform.Find("MainFuncContainer");
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerClick, GoRide);
|
||||
UIManager.AddEvent(BtnRide.gameObject, EventTriggerType.PointerEnter, OnHover);
|
||||
|
||||
Reference in new issue
Block a user