Ejemplo n.º 1
0
        public void Awake(DateElement original, RectTransform tileRect, TextMeshProUGUI monthTitle)
        {
            DateElements[0]    = original;
            TileRect           = tileRect;
            StartingTileHeight = TileRect.sizeDelta.y;

            MonthTitle = monthTitle;
        }
Ejemplo n.º 2
0
        private DateElement ConstructDateElement(int dateCount)
        {
            DateElement   newDateElement = GameObject.Instantiate(original: DateElements[dateCount - 1], parent: DateElements[dateCount - 1].transform.parent.transform) as DateElement;
            RectTransform newRect        = newDateElement.GetComponent <RectTransform>();

            if (newRect.anchoredPosition.x + DateElementOffset <= TileRect.rect.width - (TileRect.offsetMin.x + -TileRect.offsetMax.x))
            {
                newRect.anchoredPosition = new Vector3(newRect.anchoredPosition.x + DateElementOffset, newRect.anchoredPosition.y);
            }
            else
            {
                RectTransform originalRect = DateElements[0].GetComponent <RectTransform>();
                newRect.anchoredPosition = new Vector3(originalRect.anchoredPosition.x, newRect.anchoredPosition.y - DateElementOffset);
                RowOffset += DateElementOffset;
            }
            newDateElement.UpdateView(dateCount + 1);
            return(newDateElement);
        }
Ejemplo n.º 3
0
 private void ResetOriginalElement(DateElement original, int arrayLength)
 {
     DateElements    = new DateElement[arrayLength];
     DateElements[0] = original;
     DateElements[0].UpdateView(1);
 }