本文实例为大家分享了Unity实现卡牌翻动效果展示的具体代码,供大家参考,具体内容如下
事实上这是项目需要,我改的一个代码,实际上就是利用unity的一些基础属性实现其效果。啥也不多说了,先上原代码:
/// Credit Mrs. YakaYocha /// Sourced from - https://plains about this but it doesn't matter in this case. monthsVerticalScroller = new UIVerticalScrollerMove(monthsScrollingPanel, monthsButtons, monthCenter); monthsVerticalScroller.Start(); } public void SetDate() {// monthsSet = int.Parse(inputFieldMonths.text) - 1; monthsVerticalScroller.SnapToElement(monthsSet); } void Update() { monthsVerticalScroller.Update(); string monthString = monthsVerticalScroller.GetResults(); } public void MonthsScrollUp() { monthsVerticalScroller.ScrollLeft(); } public void MonthsScrollDown() { monthsVerticalScroller.ScrollRight(); } }效果与引用:
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。