Exemple #1
0
    private void Awake()
    {
        _monthContent = transform.Find("MonthContainer/MonthScrollView/Content");
        RectTransform monthCenter = transform.Find("MonthContainer/MonthCenter").GetComponent <RectTransform>();

        _dayContent = transform.Find("DayContainer/DayScrollView/Content");
        RectTransform dayCenter = transform.Find("DayContainer/DayCenter").GetComponent <RectTransform>();

        InitMonth();
        InitDay();

        _monthsVerticalScroller = new UIVerticalScroller(_monthContent.GetComponent <RectTransform>(), monthList, monthCenter);
        _dayVerticalScroller    = new UIVerticalScroller(_dayContent.GetComponent <RectTransform>(), dayList, dayCenter);

        _monthsVerticalScroller.StartingIndex = 0;
        _dayVerticalScroller.StartingIndex    = 1;

        _monthsVerticalScroller.Start();
        _dayVerticalScroller.Start();


//
//        transform.Find("Button").GetComponent<Button>().onClick.AddListener(() =>
//        {
//            string dayString = _dayVerticalScroller.GetResults();
//            string monthString = _monthsVerticalScroller.GetResults();
//
//            Debug.LogError(monthString);
//            Debug.LogError(dayString);
//        });
    }
    // Use this for initialization
    public void Awake()
    {
        InitializeYears();
        InitializeMonths();
        InitializeDays();

        //Yes Unity complains about this but it doesn't matter in this case.
        monthsVerticalScroller = new UIVerticalScroller(monthsScrollingPanel, monthsButtons, monthCenter);
        yearsVerticalScroller  = new UIVerticalScroller(yearsScrollingPanel, yearsButtons, yearsCenter);
        daysVerticalScroller   = new UIVerticalScroller(daysScrollingPanel, daysButtons, daysCenter);

        monthsVerticalScroller.Start();
        yearsVerticalScroller.Start();
        daysVerticalScroller.Start();
    }
Exemple #3
0
 private void Awake()
 {
     SetupObjects();
     VerticalScroller = new UIVerticalScroller(ScrollingViewPort, scrollObjects, ScrollCenter);
     VerticalScroller.Start();
 }