消息轮播bug修改;内容滚动匀速播放;收藏图标变大
This commit is contained in:
parent
333c99fb46
commit
7f7318fb36
@ -17,7 +17,13 @@ public class HomeMessageController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
float timer = 2;
|
float timer = 2;
|
||||||
public float? textWidth = null;
|
public float? textWidth = null;
|
||||||
[HideInInspector]public bool isAnimated = false;
|
private bool isAnimated = false;
|
||||||
|
public void Initial()
|
||||||
|
{
|
||||||
|
transform.Find("TextContainer/Content").localPosition = new Vector2(startX, transform.Find("TextContainer/Content").localPosition.y);
|
||||||
|
isAnimated = false;
|
||||||
|
}
|
||||||
|
float playtime = 0;
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
@ -30,14 +36,17 @@ public class HomeMessageController : MonoBehaviour
|
|||||||
isAnimated = true;
|
isAnimated = true;
|
||||||
var offset = textWidth.Value - 180;
|
var offset = textWidth.Value - 180;
|
||||||
var game = transform.Find("TextContainer/Content");
|
var game = transform.Find("TextContainer/Content");
|
||||||
game.DOLocalMoveX(startX - offset, 0.5f).onComplete
|
var v = 20 / 0.3f;
|
||||||
|
playtime = offset / v;
|
||||||
|
//匀速播放
|
||||||
|
game.DOLocalMoveX(startX - offset, playtime).onComplete
|
||||||
= () => Invoke("returnAni", 1.5f);
|
= () => Invoke("returnAni", 1.5f);
|
||||||
}
|
}
|
||||||
timer += 4;
|
timer += 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void returnAni()
|
void returnAni()
|
||||||
{
|
{
|
||||||
transform.Find("TextContainer/Content").DOLocalMoveX(startX, 0.5f);
|
transform.Find("TextContainer/Content").DOLocalMoveX(startX, playtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 614 B After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 1.8 KiB |
@ -61,7 +61,7 @@ public class MainController : BaseScene
|
|||||||
//切换页面后
|
//切换页面后
|
||||||
private void OnIsHomeChanged(object sender, EventArgs e)
|
private void OnIsHomeChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
DOTween.KillAll();
|
//DOTween.KillAll();
|
||||||
FinishMessage(sender);
|
FinishMessage(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +100,7 @@ public class MainController : BaseScene
|
|||||||
rightMessage.transform.SetParent(go);
|
rightMessage.transform.SetParent(go);
|
||||||
rightMessage.transform.localScale = Vector3.one;
|
rightMessage.transform.localScale = Vector3.one;
|
||||||
rightMessage.transform.localPosition = 1 * msgLocation;
|
rightMessage.transform.localPosition = 1 * msgLocation;
|
||||||
|
rightMessage.alpha = 0;
|
||||||
msgs = new List<CanvasGroup> { rightMessage };
|
msgs = new List<CanvasGroup> { rightMessage };
|
||||||
for (int i = 0; i < 5; i++)
|
for (int i = 0; i < 5; i++)
|
||||||
{
|
{
|
||||||
@ -131,7 +132,7 @@ public class MainController : BaseScene
|
|||||||
DoMessageRight(e);
|
DoMessageRight(e);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (App.currentPageIsHome)
|
if (App.currentPageIsHome)
|
||||||
{
|
{
|
||||||
DoMessage6(e);
|
DoMessage6(e);
|
||||||
}
|
}
|
||||||
@ -176,12 +177,14 @@ public class MainController : BaseScene
|
|||||||
if (msgIndex >= 6) //
|
if (msgIndex >= 6) //
|
||||||
{
|
{
|
||||||
//msgIndex = 0;
|
//msgIndex = 0;
|
||||||
|
Sequence se = DOTween.Sequence();
|
||||||
//m.transform.DOLocalMoveY(m.transform.localPosition.y - 38, 0.5f);
|
//m.transform.DOLocalMoveY(m.transform.localPosition.y - 38, 0.5f);
|
||||||
foreach (var item in msgs)
|
foreach (var item in msgs)
|
||||||
{
|
{
|
||||||
item.transform.DOLocalMoveY(item.transform.localPosition.y - 38, 0.5f);
|
se.Join(item.transform.DOLocalMoveY(item.transform.localPosition.y - 38, 0.5f));
|
||||||
}
|
}
|
||||||
m.DOFade(0, 0.5f).onComplete = () =>
|
se.Join(m.DOFade(0, 0.5f));
|
||||||
|
se.Play().onComplete = () =>
|
||||||
{
|
{
|
||||||
SetMessage(m, e);
|
SetMessage(m, e);
|
||||||
m.transform.localPosition = 1 * msgLocation;
|
m.transform.localPosition = 1 * msgLocation;
|
||||||
@ -192,12 +195,14 @@ public class MainController : BaseScene
|
|||||||
{
|
{
|
||||||
Debug.Log(191);
|
Debug.Log(191);
|
||||||
SetMessage(m, e);
|
SetMessage(m, e);
|
||||||
|
Sequence se = DOTween.Sequence();
|
||||||
for (int i = 0; i < msgIndex; i++)
|
for (int i = 0; i < msgIndex; i++)
|
||||||
{
|
{
|
||||||
var rect = msgs[i].GetComponent<RectTransform>();
|
var rect = msgs[i].GetComponent<RectTransform>();
|
||||||
rect.DOLocalMoveY(rect.localPosition.y - 38, 0.5f);
|
se.Join(rect.DOLocalMoveY(rect.localPosition.y - 38, 0.5f));
|
||||||
}
|
}
|
||||||
m.DOFade(1, 0.5f);
|
se.Join(m.DOFade(1, 0.5f));
|
||||||
|
se.Play();
|
||||||
}
|
}
|
||||||
m.transform.SetAsLastSibling();
|
m.transform.SetAsLastSibling();
|
||||||
msgIndex++;
|
msgIndex++;
|
||||||
@ -215,14 +220,17 @@ public class MainController : BaseScene
|
|||||||
FinishMessageLeft();
|
FinishMessageLeft();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
if (!(bool)sender)
|
if (!(bool)sender)
|
||||||
{
|
{
|
||||||
//FinishMessage6();
|
//FinishMessage6();
|
||||||
transform.Find("GameObject").SetAsFirstSibling();
|
//DOTween.CompleteAll(true);
|
||||||
|
DOTween.CompleteAll(true);
|
||||||
|
transform.Find("GameObject").gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
transform.Find("GameObject").SetSiblingIndex(1);
|
transform.Find("GameObject").gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -276,7 +284,7 @@ public class MainController : BaseScene
|
|||||||
txt.GetComponent<Text>().text = e.content;
|
txt.GetComponent<Text>().text = e.content;
|
||||||
LayoutRebuilder.ForceRebuildLayoutImmediate(txt);
|
LayoutRebuilder.ForceRebuildLayoutImmediate(txt);
|
||||||
Debug.Log(e.content + txt.sizeDelta.x);
|
Debug.Log(e.content + txt.sizeDelta.x);
|
||||||
m.GetComponent<HomeMessageController>().isAnimated = false;
|
m.GetComponent<HomeMessageController>().Initial();
|
||||||
m.GetComponent<HomeMessageController>().textWidth = txt.sizeDelta.x;
|
m.GetComponent<HomeMessageController>().textWidth = txt.sizeDelta.x;
|
||||||
}
|
}
|
||||||
CanvasGroup msg;
|
CanvasGroup msg;
|
||||||
@ -434,19 +442,19 @@ public class MainController : BaseScene
|
|||||||
//速度35
|
//速度35
|
||||||
if (item.Speed >= 35)
|
if (item.Speed >= 35)
|
||||||
{
|
{
|
||||||
var message = lang == "zh" ? $"骑行速度突破<color=#e3d427>{Math.Round(item.Speed, 2)}</color>KM/H!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}</color>KM/H!";
|
var message = lang == "zh" ? $"骑行速度突破<color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!";
|
||||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}35KM/H");
|
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}35KM/H");
|
||||||
}
|
}
|
||||||
//速度50
|
//速度50
|
||||||
if (item.Speed >= 50)
|
if (item.Speed >= 50)
|
||||||
{
|
{
|
||||||
var message = lang == "zh" ? $"骑行速度突破<color=#e3d427>{Math.Round(item.Speed,2)}</color>KM/H!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}</color>KM/H!";
|
var message = lang == "zh" ? $"骑行速度突破<color=#e3d427>{Math.Round(item.Speed,2)}KM/H</color>!" : $"riding speed reaches <color=#e3d427>{Math.Round(item.Speed, 2)}KM/H</color>!";
|
||||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}50KM/H");
|
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}50KM/H");
|
||||||
}
|
}
|
||||||
//功体比
|
//功体比
|
||||||
if (item.WeightKg >= 3)
|
if (item.WeightKg >= 3)
|
||||||
{
|
{
|
||||||
var message = lang == "zh" ? $"骑行功体比突破<color=#e3d427>{Math.Round(item.WeightKg, 2)}</color>w/kg!" : $" riding w/kg reaches <color=#e3d427>{Math.Round(item.WeightKg, 2)}</color>w/kg!";
|
var message = lang == "zh" ? $"骑行功体比突破<color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!" : $" riding PWR reaches <color=#e3d427>{Math.Round(item.WeightKg, 2)}w/kg</color>!";
|
||||||
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}3WeightKg");
|
EventQueueSystem.QueueEventOnce(new LinkedMessageEvent(item.RouteId, message, item.HeadImage, item.Name, item.RouteName), $"{item.RouteId}{item.Name}3WeightKg");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -256,7 +256,7 @@ PlayerSettings:
|
|||||||
clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
|
clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea
|
||||||
templatePackageId: com.unity.template.3d@4.2.8
|
templatePackageId: com.unity.template.3d@4.2.8
|
||||||
templateDefaultScene: Assets/Scenes/SampleScene.unity
|
templateDefaultScene: Assets/Scenes/SampleScene.unity
|
||||||
AndroidTargetArchitectures: 1
|
AndroidTargetArchitectures: 3
|
||||||
AndroidSplashScreenScale: 0
|
AndroidSplashScreenScale: 0
|
||||||
androidSplashScreen: {fileID: 0}
|
androidSplashScreen: {fileID: 0}
|
||||||
AndroidKeystoreName: '{inproject}: Assets/Plugins/Android/powerfun.keystore'
|
AndroidKeystoreName: '{inproject}: Assets/Plugins/Android/powerfun.keystore'
|
||||||
@ -868,7 +868,7 @@ PlayerSettings:
|
|||||||
platformArchitecture:
|
platformArchitecture:
|
||||||
iPhone: 1
|
iPhone: 1
|
||||||
scriptingBackend:
|
scriptingBackend:
|
||||||
Android: 0
|
Android: 1
|
||||||
Standalone: 0
|
Standalone: 0
|
||||||
il2cppCompilerConfiguration:
|
il2cppCompilerConfiguration:
|
||||||
Standalone: 0
|
Standalone: 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user