透明小地图&列表点击切换&海拔图头像位移
This commit is contained in:
1 parent
bf48989a9c
commit
6ec4c0101b
114 files changed
+12787
-6517
No files matched your search
@@ -0,0 +1,42 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using PolyAndCode.UI;
|
||||
|
||||
//Cell class for demo. A cell in Recyclable Scroll Rect must have a cell class inheriting from ICell.
|
||||
//The class is required to configure the cell(updating UI elements etc) according to the data during recycling of cells.
|
||||
//The configuration of a cell is done through the DataSource SetCellData method.
|
||||
//Check RecyclableScrollerDemo class
|
||||
public class DemoCell : MonoBehaviour, ICell
|
||||
{
|
||||
//UI
|
||||
public Text nameLabel;
|
||||
public Text genderLabel;
|
||||
public Text idLabel;
|
||||
|
||||
//Model
|
||||
private ContactInfo _contactInfo;
|
||||
private int _cellIndex;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//Can also be done in the inspector
|
||||
GetComponent<Button>().onClick.AddListener(ButtonListener);
|
||||
}
|
||||
|
||||
//This is called from the SetCell method in DataSource
|
||||
public void ConfigureCell(ContactInfo contactInfo,int cellIndex)
|
||||
{
|
||||
_cellIndex = cellIndex;
|
||||
_contactInfo = contactInfo;
|
||||
|
||||
nameLabel.text = contactInfo.Name;
|
||||
genderLabel.text = contactInfo.Gender;
|
||||
idLabel.text = contactInfo.id;
|
||||
}
|
||||
|
||||
|
||||
private void ButtonListener()
|
||||
{
|
||||
Debug.Log("Index : " + _cellIndex + ", Name : " + _contactInfo.Name + ", Gender : " + _contactInfo.Gender);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user