示例#1
0
 public void configure(DayElement dayElement, Action onClickAction)
 {
     this.dayElement      = dayElement;
     this.sleepUnits.text = dayElement.GetSleepCount() + "";
     this.date.text       = dayElement.GetDate();
     this.onClick         = onClickAction;
     this.duration.text   = TimeRecordUtility.MiliSecToDuration(dayElement.GetTotalSleepTime());
 }
示例#2
0
 public void configure(Record record, bool interactable)
 {
     this.record       = record;
     this.interactable = interactable;
     transform.Find("Start").GetComponent <Text>().text    = TimeRecordUtility.DateTimeToTimeString(record.getStartDateTime());
     transform.Find("End").GetComponent <Text>().text      = TimeRecordUtility.DateTimeToTimeString(record.getEndDateTime());
     transform.Find("Duration").GetComponent <Text>().text = TimeRecordUtility.DurationAsString(record);
 }
示例#3
0
    public double GetTotalSleepTime()
    {
        double totalSleepTime = 0;

        foreach (Record record in records)
        {
            totalSleepTime += TimeRecordUtility.DurationInMiliSec(record);
        }
        return(totalSleepTime);
    }
    public void configure(DayElement dayElement, SleepElement sleepElement, bool interactable)
    {
        this.dayElement   = dayElement;
        this.sleepElement = sleepElement;
        this.interactable = interactable;

        String count = "";

        if (sleepElement.GetRecords().Count > 1)
        {
            count = (sleepElement.GetRecords().Count - 1) + "";
        }
        this.sleepUnits.text = count;
        this.duration.text   = TimeRecordUtility.MiliSecToDuration(sleepElement.GetTotalSleepTime());

        Record[] array         = sleepElement.GetRecords().ToArray();
        String   startDateTime = TimeRecordUtility.DateTimeToTimeString(array[array.Length - 1].getStartDateTime());
        String   endDateTime   = TimeRecordUtility.DateTimeToTimeString(array[0].getEndDateTime());

        this.fromTo.text = startDateTime + " - " + endDateTime;
    }
示例#5
0
 private void Update()
 {
     GetComponent <Text>().text = TimeRecordUtility.DurationAsString(RecordManager.getActiveTimeRecord());
 }
示例#6
0
 public String GetDate()
 {
     return(TimeRecordUtility.DateTimeToDateString(date));
 }