少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-27 087939b9e6654b8f3ecf59d5ed3fb7224f540424
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//--------------------------------------------------------
//    [Author]:           第二世界
//    [  Date ]:           Wednesday, November 01, 2017
//--------------------------------------------------------
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
using UnityEngine.EventSystems;
 
namespace Snxxz.UI
{
 
    public class AutoSelectCyclicScroll : CyclicScroll
    {
        public bool autoSelectable
        {
            get { return Time.time > allowSelectTime; }
        }
 
        float allowSelectTime = 0f;
        float forbidTime = 0f;
 
        public void TrySelectData<T>(T _data)
        {
            var index = datas.IndexOf(_data);
            if (index != -1)
            {
                MoveToCenter(index);
                allowSelectTime = Time.time + forbidTime;
            }
        }
 
        [ContextMenu("Arrange")]
        public override void ReArrange()
        {
            base.ReArrange();
        }
 
    }
 
}