意见反馈 修改细节
This commit is contained in:
1 parent
1c712ff7d5
commit
dd08f916eb
41 files changed
+7043
-1134
No files matched your search
@@ -1,4 +1,6 @@
|
||||
using System.Collections;
|
||||
using Assets.Scripts;
|
||||
using DG.Tweening;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
@@ -8,7 +10,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
private ScrollRect scroll;
|
||||
private Transform content;
|
||||
private Transform content,lightbg;
|
||||
private float contentSize;
|
||||
private int count;
|
||||
[SerializeField] Button L, R;
|
||||
@@ -16,6 +18,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
{
|
||||
scroll = gameObject.GetComponent<ScrollRect>();
|
||||
content = gameObject.transform.Find("Viewport").Find("Content");
|
||||
lightbg = transform.parent.Find("Light");
|
||||
//Initial();
|
||||
if (L != null)
|
||||
{
|
||||
@@ -34,6 +37,14 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
//R.onClick.AddListener(goRight);
|
||||
}
|
||||
}
|
||||
|
||||
private void doAni()
|
||||
{
|
||||
lightbg.GetComponent<Image>().color = Utils.HexToColorHtml("#ffffff00");
|
||||
lightbg.GetComponent<Image>().gameObject.SetActive(false);
|
||||
//lightbg.GetComponent<Image>().DOFade(0, 0.15f);
|
||||
}
|
||||
|
||||
public void Initial()
|
||||
{
|
||||
count = content.childCount;
|
||||
@@ -55,6 +66,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
void goLeft()
|
||||
{
|
||||
if (scroll.horizontalNormalizedPosition <= contentSize) return;
|
||||
doAni();
|
||||
if (!start) startPosition = scroll.horizontalNormalizedPosition;
|
||||
start = true;
|
||||
scrollValue = -1 * contentSize / 30;
|
||||
@@ -62,6 +74,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
void goRight()
|
||||
{
|
||||
if ((scroll.horizontalNormalizedPosition + contentSize) >= 1) return;
|
||||
doAni();
|
||||
if (!start) startPosition = scroll.horizontalNormalizedPosition;
|
||||
start = true;
|
||||
scrollValue = contentSize / 30;
|
||||
@@ -78,7 +91,10 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
string c;
|
||||
if (i == index)
|
||||
{
|
||||
lightbg.GetComponent<Image>().gameObject.SetActive(true);
|
||||
lightbg.GetComponent<Image>().DOFade(1, 0.2f);
|
||||
content.GetChild(i).GetComponent<QuickLoginUser>().setActive();
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -98,7 +114,6 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
start = false;
|
||||
scroll.horizontalNormalizedPosition = startPosition + totalScrollValue;
|
||||
//Debug.Log();
|
||||
|
||||
SetColor();
|
||||
totalScrollValue = 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user