暂存
This commit is contained in:
1 parent
e7044b3cde
commit
cbc79df8a2
72 files changed
+15352
-444
No files matched your search
@@ -0,0 +1,36 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class ScrollTest : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
private ScrollRect scroll;
|
||||
void Start()
|
||||
{
|
||||
scroll = gameObject.GetComponent<ScrollRect>();
|
||||
}
|
||||
private bool dir = true;
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (dir)
|
||||
{
|
||||
scroll.horizontalNormalizedPosition += 0.01f;
|
||||
if (scroll.horizontalNormalizedPosition >= 1)
|
||||
{
|
||||
dir = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
scroll.horizontalNormalizedPosition -= 0.01f;
|
||||
if (scroll.horizontalNormalizedPosition <= 0)
|
||||
{
|
||||
dir = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user