protected override void Awake() { base.Awake(); actualIndex = startingIndex; cellIndex = startingIndex; this.onLerpComplete = new OnLerpCompleteEvent(); this.onRelease = new OnReleaseEvent(); this.scrollRect = GetComponent <ScrollRect>(); this.canvasGroup = GetComponent <CanvasGroup>(); this.content = scrollRect.content; this.cellSize = content.GetComponent <GridLayoutGroup>().cellSize; content.anchoredPosition = new Vector2(-cellSize.x * cellIndex, content.anchoredPosition.y); int count = LayoutElementCount(); //Debug.Log(""+count); //int count = 8; SetContentSize(count); if (startingIndex < count) { MoveToIndex(startingIndex); } soundManager = GameObject.Find("SoundManager").GetComponent <SoundManager>(); }
protected override void Awake() { base.Awake(); onLerpComplete = new OnLerpCompleteEvent(); //this.onRelease = new OnReleaseEvent(); m_ActualCellIndex = m_StartIndex; m_CellIndex = m_StartIndex; m_ScrollRect = GetComponent <ScrollRect>(); m_CanvasGroup = GetComponent <CanvasGroup>(); m_Content = m_ScrollRect.content; m_ContentCellSize = m_Content.GetComponent <GridLayoutGroup>().cellSize; // Content 위치 초기화 m_Content.anchoredPosition = new Vector2(-m_ContentCellSize.x * m_CellIndex, m_Content.anchoredPosition.y); // Item 개수 계산 int itemCount = GetChildElementCount(); // Content 최종 사이즈 설정 SetContentSize(itemCount); if (m_StartIndex < itemCount) { MoveToIndex(m_StartIndex); } }
protected override void Awake() { base.Awake(); actualIndex = startingIndex; cellIndex = startingIndex; this.onLerpComplete = new OnLerpCompleteEvent(); this.onRelease = new OnReleaseEvent(); this.scrollRect = GetComponent <ScrollRect>(); this.canvasGroup = GetComponent <CanvasGroup>(); this.content = scrollRect.content; this.cellSize = content.GetComponent <GridLayoutGroup>().cellSize; content.anchoredPosition = new Vector2(-cellSize.x * cellIndex, content.anchoredPosition.y); int count = LayoutElementCount(); SetContentSize(count); pieCharts = new List <PieChart>(); filePaths = new List <String>(); sleepDatas = new List <List <SleepData> >(); sleepHeaderDatas = new List <SleepHeaderData>(); if (startingIndex < count) { MoveToIndex(startingIndex); } }
protected override void Awake() { base.Awake(); actualIndex = startingIndex; cellIndex = startingIndex; this.onLerpComplete = new OnLerpCompleteEvent(); this.onRelease = new OnReleaseEvent(); this.scrollRect = GetComponent <ScrollRect>(); this.content = scrollRect.content; //this.cellSize = new Vector2(content.sizeDelta.x * content.localScale.x,content.sizeDelta.y * content.localScale.y); //content.anchoredPosition = new Vector2(-elementInScroll.rect.width * cellIndex, content.anchoredPosition.y); //int count = LayoutElementCount(); //SetContentSize(count); //if(startingIndex < count) { // MoveToIndex(startingIndex); //} }
protected override void Awake() { base.Awake(); actualIndex = startingIndex; cellIndex = startingIndex; onLerpComplete = new OnLerpCompleteEvent(); onRelease = new OnReleaseEvent(); scrollRect = GetComponent <ScrollRect>(); canvasGroup = GetComponent <CanvasGroup>(); content = scrollRect.content; cellSize = content.GetComponent <GridLayoutGroup>().cellSize; content.anchoredPosition = new Vector2(-cellSize.x * cellIndex, content.anchoredPosition.y); int count = LayoutElementCount(); SetContentSize(count); if (startingIndex < count) { MoveToIndex(startingIndex); } }
public void reCalculateEverything() { actualIndex = startingIndex; cellIndex = startingIndex; this.onLerpComplete = new OnLerpCompleteEvent(); this.onRelease = new OnReleaseEvent(); this.scrollRect = GetComponent <ScrollRect>(); this.canvasGroup = GetComponent <CanvasGroup>(); this.content = scrollRect.content; this.cellSize = content.GetComponent <GridLayoutGroup>().cellSize; content.anchoredPosition = new Vector2(-cellSize.x * cellIndex, content.anchoredPosition.y); //int count = LayoutElementCount(); //int count = 8; SetContentSize(numberOfPages); if (startingIndex < numberOfPages) { MoveToIndex(startingIndex); } }