コード例 #1
0
    void Awake()
    {
        _controller           = GameObject.Find("mainCtr").GetComponent <MainController>();
        _controller._calendar = cal;
        cal.initFlatCalendar();
        cal.setUIStyle(4);
        user_nickname.text = _controller._user.nickname;
        user_email.text    = _controller._user.email;
        Dictionary <string, Events> event_list = _controller._user.events_list;
        List <Group> group_list = _controller.group_list;

        //Debug.Log("count= " + event_list.Count);
        foreach (KeyValuePair <string, Events> items in event_list)
        {
            Events   item   = items.Value;
            EventObj newobj = new FlatCalendar.EventObj(items.Key, item.title, item.description, item.hour, item.min, item.place);
            cal.addEvent(item.year, item.month, item.day, newobj);
            eventToObj.Add(items.Key, newobj);
            Debug.Log("newobj :" + newobj.name);
        }


        int gidx = 1;

        foreach (Group g in group_list)
        {
            GameObject tmp = group_view.transform.GetChild(gidx).gameObject;
            tmp.SetActive(true);
            tmp.transform.GetChild(0).GetComponent <Text>().text = g.name;
            gidx++;
        }
        // cal.addEvent(2019, 11, 4, new FlatCalendar.EventObj("a", "b"));
        cal.updateUiLabelEvents(cal.currentTime.year, cal.currentTime.month, cal.currentTime.day);
    }
コード例 #2
0
ファイル: FlatCalendar_Demo.cs プロジェクト: QitzPub/kintai
    // Use this for initialization
    void Start()
    {
        // Get Flat Calendar Instance
        flatCalendar = GameObject.Find("FlatCalendar").GetComponent <FlatCalendar>();

        // Initialize Flat Calendar
        flatCalendar.initFlatCalendar();

        // Install Demo Event List
        flatCalendar.installDemoData();

        // Add Events Callbacks
        flatCalendar.setCallback_OnDaySelected(dayUpdated);
        flatCalendar.setCallback_OnMonthChanged(monthUpdated);
        flatCalendar.setCallback_OnEventSelected(eventsDiscovered);
        flatCalendar.setCallback_OnNowday(backHome);

        // Set UI Style
        flatCalendar.setUIStyle(1);

        // Add Event Demo
        EventObj demoEvent = new EventObj("Event Name", "Event Description");

        flatCalendar.addEvent(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, demoEvent);
    }