Copy Aetheria Code
Added a bunch of code from the old Aetheria project
This commit is contained in:
parent
ab392cd3d6
commit
c58ba0b1da
1704 changed files with 175081 additions and 313 deletions
|
|
@ -0,0 +1,80 @@
|
|||
namespace UnityEngine.UI.Extensions.Examples
|
||||
{
|
||||
public class UpdateScrollSnap : MonoBehaviour
|
||||
{
|
||||
|
||||
public UnityEngine.UI.Extensions.HorizontalScrollSnap HSS;
|
||||
public UnityEngine.UI.Extensions.VerticalScrollSnap VSS;
|
||||
public GameObject HorizontalPagePrefab;
|
||||
public GameObject VerticalPagePrefab;
|
||||
public UnityEngine.UI.InputField JumpPage;
|
||||
|
||||
|
||||
public void AddButton()
|
||||
{
|
||||
if (HSS)
|
||||
{
|
||||
var newHSSPage = GameObject.Instantiate(HorizontalPagePrefab);
|
||||
HSS.AddChild(newHSSPage);
|
||||
}
|
||||
if (VSS)
|
||||
{
|
||||
var newVSSPage = GameObject.Instantiate(VerticalPagePrefab);
|
||||
VSS.AddChild(newVSSPage);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveButton()
|
||||
{
|
||||
GameObject removed, removed2;
|
||||
if (HSS)
|
||||
{
|
||||
HSS.RemoveChild(HSS.CurrentPage, out removed);
|
||||
removed.SetActive(false);
|
||||
}
|
||||
if (VSS)
|
||||
{
|
||||
VSS.RemoveChild(VSS.CurrentPage, out removed2);
|
||||
removed2.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
public void JumpToPage()
|
||||
{
|
||||
int jumpPage = int.Parse(JumpPage.text);
|
||||
if (HSS)
|
||||
{
|
||||
HSS.GoToScreen(jumpPage);
|
||||
}
|
||||
if (VSS)
|
||||
{
|
||||
VSS.GoToScreen(jumpPage);
|
||||
}
|
||||
}
|
||||
|
||||
public void SelectionStartChange()
|
||||
{
|
||||
Debug.Log("Scroll Snap change started");
|
||||
}
|
||||
public void SelectionEndChange()
|
||||
{
|
||||
Debug.Log("Scroll Snap change finished");
|
||||
}
|
||||
public void PageChange(int page)
|
||||
{
|
||||
Debug.Log(string.Format("Scroll Snap page changed to {0}", page));
|
||||
}
|
||||
|
||||
public void RemoveAll()
|
||||
{
|
||||
GameObject[] children;
|
||||
HSS.RemoveAllChildren(out children);
|
||||
VSS.RemoveAllChildren(out children);
|
||||
}
|
||||
|
||||
public void JumpToSelectedToggle(int page)
|
||||
{
|
||||
HSS.GoToScreen(page);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue