Advertisement
diegographics

Untitled

Apr 24th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using EnhancedUI.EnhancedScroller;
  5.  
  6. public class TestScrollerController : MonoBehaviour, IEnhancedScrollerDelegate {
  7.  
  8.     private List<TestData> _data;
  9.     public EnhancedScroller myScroller;
  10.     public TestCellView testCellViewPrefab;
  11.  
  12.     void Start (){
  13.  
  14.         _data.Add (new TestData () {
  15.             Name = "Match01",
  16.             Description = "Das erste gefundene Match in der Liste, Hier nach muesste geloopt werden. hoffen wir doch mal...."
  17.         });
  18.         _data.Add (new TestData () {
  19.             Name = "Match02",
  20.             Description = "Das zweite gefundene Match in der Liste wird hier angezeigt als Loop"
  21.         });
  22.         _data.Add (new TestData () {
  23.             Name = "Letztes Match",
  24.             Description = "Eine schleife ist erst mit drei durchlaeufen erreicht, deswegen hier der Dritte eintrag in der Liste"
  25.         });
  26.         myScroller.Delegate = this;
  27.         myScroller.ReloadData();
  28.     }
  29.     public int GetNumberOfCells(EnhancedScroller scroller)
  30.     {
  31.         return _data.Count;
  32.     }
  33.     public float GetCellViewSize(EnhancedScroller scroller, int dataIndex)
  34.     {
  35.         return 100f;
  36.     }
  37.  
  38.     public EnhancedScrollerCellView GetCellView (EnhancedScroller scroller, int
  39.         dataIndex, int cellIndex)
  40.     {
  41.         TestCellView cellView = scroller.GetCellView (testCellViewPrefab) as
  42.             TestCellView;
  43.         cellView.SetData (_data [dataIndex]);
  44.         return cellView;
  45.     }
  46.  
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement