IListBox.cs
2.91 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using AirFishLab.ScrollingList.ContentManagement;
using UnityEngine;
namespace AirFishLab.ScrollingList
{
/// <summary>
/// The interface of the list box
/// </summary>
public interface IListBox
{
/// <summary>
/// The id of the box
/// </summary>
int ListBoxID { get; }
/// <summary>
/// The id of the content that the box refers
/// </summary>
int ContentID { get; }
/// <summary>
/// The last list box
/// </summary>
IListBox LastListBox { get; }
/// <summary>
/// The next list box
/// </summary>
IListBox NextListBox { get; }
/// <summary>
/// The event to be invoked when the box is selected
/// </summary>
ListBoxSelectedEvent OnBoxSelected { get; }
/// <summary>
/// Is the box activated?
/// </summary>
bool IsActivated { get; set; }
/// <summary>
/// The list which this box belongs to
/// </summary>
CircularScrollingList ScrollingList { get; }
/// <summary>
/// Initialize the list box
/// </summary>
/// <param name="scrollingList">The list which this box belongs to</param>
/// <param name="listBoxID">The id of the box</param>
/// <param name="lastListBox">The last box</param>
/// <param name="nextListBox">The next box</param>
void Initialize(
CircularScrollingList scrollingList,
int listBoxID, IListBox lastListBox, IListBox nextListBox);
/// <summary>
/// Get the transform of the box
/// </summary>
/// <returns>The transform of the box</returns>
Transform GetTransform();
/// <summary>
/// Get the box position factor in the list
/// </summary>
/// <returns>The box position factor</returns>
float GetPositionFactor();
/// <summary>
/// The function to be invoked when the box is moved
/// NOTE: This function is for the future feature
/// </summary>
/// <param name="positionRatio">
/// The ratio of the position in the list, which is from -1 to 1.
/// 0 means that thw box is at the center of the list
/// </param>
void OnBoxMoved(float positionRatio);
/// <summary>
/// Set the content id of the box
/// </summary>
/// <param name="contentID">The content id</param>
void SetContentID(int contentID);
/// <summary>
/// Set the content for the box
/// </summary>
/// <param name="content">The content</param>
void SetContent(IListContent content);
/// <summary>
/// Pop the box to the front
/// </summary>
void PopToFront();
/// <summary>
/// Push the box to the back
/// </summary>
void PushToBack();
}
}