Merge remote-tracking branch 'origin/dev_cyp' into dev_lishuo

This commit is contained in:
lishuo committed 2022-01-25 09:28:20 +08:00
commit 5340d3d58b
17 files changed
+1341 -99

No files matched your search

+1 -1
View File
@@ -622,7 +622,7 @@ public class LoginController : BaseScene
//#endif
App.notifyContent = r.data.Value<string>("Content");
if (r.data.Value<int>("Id") != notifyId)//r.data.Value<int>("Id") != notifyId
if (r.data.Value<int>("Id") != notifyId && r.data.Value<int>("Id") != 0)//r.data.Value<int>("Id") != notifyId
{
UIManager.ShowNewsModal();
PlayerPrefs.SetInt("notifyId", r.data.Value<int>("Id"));
+29 -69
View File
@@ -71,6 +71,7 @@ public class MainController : BaseScene
CanvasGroup rightMessage;
private void InitialMessage()
{
Debug.Log("初始化组件");
#if UNITY_STANDALONE_WIN
msgLocation = 1 * msg.transform.localPosition;
var go = transform.Find("GameObject");
@@ -100,7 +101,6 @@ public class MainController : BaseScene
DestroyImmediate(transform.Find("GameObject/Message").gameObject);
var m = Resources.Load<GameObject>("UI/Prefab/NewRoute/Mobile/Message");
rightMessage = Instantiate<GameObject>(m).GetComponent<CanvasGroup>();
rightMessage.transform.SetParent(go);
rightMessage.transform.localScale = Vector3.one;
rightMessage.transform.localPosition = 1 * msgLocation;
@@ -121,63 +121,38 @@ public class MainController : BaseScene
#endif
}
private void ShowQueueMessage()
{
int i = 0,count = App.globalMessageQueue.Count;
while (App.globalMessageQueue.Count != 0)
{
//SetMessage(msgs[i], App.globalMessageQueue.Dequeue());
var v = 1 * msgLocation;
// 0 1 2
// 2 1 0
msgs[i].transform.localPosition = new Vector3(v.x, v.y - (count - 1 - i) * moveOffset, v.z);
msgs[i].alpha = 1;
msgs[i].gameObject.SetActive(true);
SetMessage(msgs[i], App.globalMessageQueue.Dequeue());
i++;
}
msgIndex = i;
}
private void LinkedMessageHandler(LinkedMessageEvent e)
{
//msg.transform.Find("Content")
if (App.globalMessageQueue.Count == 5)
{
App.globalMessageQueue.Dequeue();
}
App.globalMessageQueue.Enqueue(e);
emptyt = 0;
//#if UNITY_STANDALONE_WIN
// Debug.Log(e.content);
// if (App.currentPageIsHome)
// {
// DoMessage(e);
// }
// else
// {
// DoMessageRight(e);
// }
//#else
// if (App.currentPageIsHome)
// {
// DoMessage6(e);
// }
//#endif
if (App.currentPageIsHome)
{
DoMessage6(e);
}
}
private void DoMessageRight(LinkedMessageEvent e)
{
SetMessage(rightMessage, e);
rightMessage.DOFade(1, 0.5f).onComplete = () => Invoke("fade0", 0.8f);
}
private void DoMessage(LinkedMessageEvent e)
{
var selectIndex = msgIndex % 3;
var m = msgs[selectIndex];
if (msgIndex >= 3) //
{
//msgIndex = 0;
m.DOFade(0, 0.5f).onComplete = ()=>
{
SetMessage(m, e);
m.transform.localPosition = new Vector3(msgLocation.x, msgLocation.y - 54 * 2, msgLocation.z);
m.DOFade(1, 0.5f);
foreach (var item in msgs.Where((x, i) => i != selectIndex))
{
item.transform.DOLocalMoveY(item.transform.localPosition.y + 54, 0.5f);
}
};
}
else
{
SetMessage(m, e);
m.transform.localPosition = new Vector3(msgLocation.x, msgLocation.y - 54 * (msgIndex % 3), msgLocation.z);
m.DOFade(1, 0.5f);
}
msgIndex++;
}
#if UNITY_STANDALONE_WIN
float moveOffset = 74;
#else
@@ -187,6 +162,7 @@ public class MainController : BaseScene
{
//Resources.UnloadUnusedAssets();
//GC.Collect();
Debug.Log(msgIndex);
var selectIndex = msgIndex % 5;
var m = msgs[selectIndex];
if (msgIndex >= 5) //
@@ -208,7 +184,6 @@ public class MainController : BaseScene
}
else
{
Debug.Log(191);
SetMessage(m, e);
Sequence se = DOTween.Sequence();
for (int i = 0; i < msgIndex; i++)
@@ -264,20 +239,6 @@ public class MainController : BaseScene
//#endif
}
void FinishMessageRight()
{
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.GetComponent<Button>().onClick.RemoveAllListeners();
@@ -304,9 +265,8 @@ public class MainController : BaseScene
var txt = m.transform.Find("TextContainer/Content").GetComponent<RectTransform>();
txt.GetComponent<Text>().text = e.content;
LayoutRebuilder.ForceRebuildLayoutImmediate(txt);
Debug.Log(e.content + txt.sizeDelta.x);
m.GetComponent<HomeMessageController>().Initial();
m.GetComponent<HomeMessageController>().textWidth = txt.sizeDelta.x;
//Debug.Log(e.content + txt.sizeDelta.x);
m.GetComponent<HomeMessageController>().Initial(txt.sizeDelta.x);
}
CanvasGroup msg;
void fade0()
@@ -317,7 +277,6 @@ public class MainController : BaseScene
// Start is called before the first frame update
async void Start()
{
UIManager.Instance.Root = root;
UIManager.Instance.MainPanel = this.transform.Find("Panel").GetComponent<PFUIPanel>();
UIManager.Instance.ModalsPanel = this.transform.Find("ModalPanel").GetComponent<PFUIPanel>();
@@ -325,6 +284,7 @@ public class MainController : BaseScene
$"{Math.Round(SystemInfo.batteryLevel * 100, 0)}%";
transform.Find("MobileInfo/TimeText").GetComponent<Text>().text =
DateTime.Now.ToString("HH:mm");
ShowQueueMessage();
#if UNITY_EDITOR
if (App.CurrentUser == null) //App.CurrentUser == null
{
@@ -99,7 +99,7 @@ namespace Assets.Scenes.Ride.Scripts
this.routeId = routeId;
this.content = content;
}
public LinkedMessageEvent(int routeId, string content,string avatar,string nickname,string routeName)
public LinkedMessageEvent(int routeId, string content, string avatar, string nickname, string routeName)
{
this.routeId = routeId;
this.content = content;
@@ -107,6 +107,14 @@ namespace Assets.Scenes.Ride.Scripts
this.nickname = nickname;
this.routeName = routeName;
}
public LinkedMessageEvent(LinkedMessageEvent data)
{
this.routeId = data.routeId;
this.content = data.content;
this.avatar = data.avatar;
this.nickname = data.nickname;
this.routeName = data.routeName;
}
private void CreateContent()
{