增加移动端界面暂存
This commit is contained in:
1 parent
31e8e3bebb
commit
3c9d489c76
56 files changed
+59321
-2517
No files matched your search
@@ -17,6 +17,10 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
void Start()
|
||||
{
|
||||
scroll = gameObject.GetComponent<ScrollRect>();
|
||||
//scroll.onValueChanged.AddListener((a) =>
|
||||
//{
|
||||
// Debug.Log(a);
|
||||
//});
|
||||
content = gameObject.transform.Find("Viewport").Find("Content");
|
||||
lightbg = transform.parent.Find("Light");
|
||||
//Initial();
|
||||
@@ -42,9 +46,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
{
|
||||
lightbg.GetComponent<Image>().color = Utils.HexToColorHtml("#ffffff00");
|
||||
lightbg.GetComponent<Image>().gameObject.SetActive(false);
|
||||
int index = (int)System.Math.Round(
|
||||
(scroll.horizontalNormalizedPosition + (contentSize / 2)) / contentSize,
|
||||
0);
|
||||
int index = GetIndex();
|
||||
content.GetChild(index).GetComponent<QuickLoginUser>().setNoActive();
|
||||
//lightbg.GetComponent<Image>().DOFade(0, 0.15f);
|
||||
}
|
||||
@@ -52,6 +54,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
public void Initial()
|
||||
{
|
||||
count = content.childCount;
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
if (content.childCount - 2 > 0)
|
||||
{
|
||||
contentSize = 1f / (content.childCount - 2);
|
||||
@@ -60,11 +63,27 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
{
|
||||
contentSize = 0;
|
||||
}
|
||||
#else
|
||||
if (content.childCount - 3 > 0)
|
||||
{
|
||||
contentSize = 1f / (content.childCount - 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
contentSize = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
//scroll.horizontalNormalizedPosition = 0;
|
||||
Canvas.ForceUpdateCanvases();
|
||||
var i = PlayerPrefs.GetInt("UserInfoIndex");
|
||||
Debug.Log($"51 {i}");
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
scroll.horizontalNormalizedPosition = contentSize/2+i*contentSize;
|
||||
#else
|
||||
scroll.horizontalNormalizedPosition = i * contentSize;
|
||||
Debug.Log(scroll.horizontalNormalizedPosition);
|
||||
#endif
|
||||
SetColor();
|
||||
}
|
||||
void goLeft()
|
||||
@@ -74,7 +93,8 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
}
|
||||
void goRight()
|
||||
{
|
||||
if ((scroll.horizontalNormalizedPosition + contentSize) >= 1) return;
|
||||
Debug.Log(scroll.horizontalNormalizedPosition);
|
||||
if (scroll.horizontalNormalizedPosition+0.0001 >= 1) return;
|
||||
goMove();
|
||||
}
|
||||
void goMove(int i = 1)
|
||||
@@ -82,15 +102,25 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
doAni();
|
||||
if (!start) startPosition = scroll.horizontalNormalizedPosition;
|
||||
start = true;
|
||||
scrollValue = i*contentSize / 30;
|
||||
scrollValue = i*contentSize / 10;
|
||||
}
|
||||
private bool start = false;
|
||||
private float scrollValue = 0, totalScrollValue = 0, startPosition = 0;
|
||||
void SetColor()
|
||||
int GetIndex()
|
||||
{
|
||||
int index = (int)System.Math.Round(
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
return (int)System.Math.Round(
|
||||
(scroll.horizontalNormalizedPosition + (contentSize / 2)) / contentSize,
|
||||
0);
|
||||
#else
|
||||
return (int)System.Math.Round(
|
||||
(scroll.horizontalNormalizedPosition+ contentSize) / contentSize,
|
||||
0);
|
||||
#endif
|
||||
}
|
||||
void SetColor()
|
||||
{
|
||||
int index = GetIndex();
|
||||
//lightbg.GetComponent<Image>().gameObject.SetActive(true);
|
||||
//lightbg.GetComponent<Image>().DOFade(1, 0.2f);
|
||||
//content.GetChild(index).GetComponent<QuickLoginUser>().setActive();
|
||||
@@ -111,7 +141,7 @@ public class QuickLoginScroll : MonoBehaviour
|
||||
}
|
||||
}
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
void FixedUpdate()
|
||||
{
|
||||
if (start)
|
||||
{
|
||||
|
||||
@@ -250,7 +250,11 @@ public class EditUserController : PFUIPanel
|
||||
{
|
||||
UIManager.ShowConfirm("Logout", "Do you want to log out and change accounts?", () =>
|
||||
{
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
SceneManager.LoadScene("Login");
|
||||
#else
|
||||
SceneManager.LoadScene("Login-Mobile");
|
||||
#endif
|
||||
UIManager.CloseConfirm();
|
||||
},2);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,11 @@ public class UserInfoController : PFUIPanel
|
||||
{
|
||||
UIManager.ShowConfirm("Logout", "Do you want to log out and change accounts?", () =>
|
||||
{
|
||||
#if !(UNITY_ANDROID || UNITY_IOS)
|
||||
SceneManager.LoadScene("Login");
|
||||
#else
|
||||
SceneManager.LoadScene("Login-Mobile");
|
||||
#endif
|
||||
UIManager.CloseConfirm();
|
||||
},2);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user