//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void Awake() { if (RowContainer == null) { RowContainer = gameObject.transform.Find("Rows"); } if (ActiveRow == null) { ActiveRow = GetComponentInChildren <HoverLayoutArcRow>(); } }
/*--------------------------------------------------------------------------------------------*/ private void BuildRow(GameObject pRowGo, string pRowTitle) { pRowGo.AddComponent <TreeUpdater>(); HoverLayoutArcRow layoutArc = pRowGo.AddComponent <HoverLayoutArcRow>(); layoutArc.ArcDegrees = 90; layoutArc.DegreePadding = 0.2f; HovercastRowTitle title = pRowGo.AddComponent <HovercastRowTitle>(); title.RowTitle = pRowTitle; }
/*--------------------------------------------------------------------------------------------*/ private void FadeRow(HoverLayoutArcRow pRow, float pAlpha) { if (pRow == null || !pRow.gameObject.activeSelf) { return; } pRow.GetComponentsInChildren(true, vItemDataResults); for (int i = 0; i < vItemDataResults.Count; i++) { FadeItem(vItemDataResults[i], pAlpha); } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ private void UpdateRow(HoverLayoutArcRow pRow, bool pPreventHighlight) { if (pRow == null || !pRow.gameObject.activeSelf) { return; } pRow.GetComponentsInChildren(true, vItemHighStateResults); for (int i = 0; i < vItemHighStateResults.Count; i++) { UpdateHighState(vItemHighStateResults[i], pPreventHighlight); } }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void NavigateBack(HovercastRowSwitchingInfo.RowEntryType pRowEntry = HovercastRowSwitchingInfo.RowEntryType.FromInside) { if (vRowHistory.Count == 0) { Debug.LogWarning("Can't navigate back. No rows left in history."); return; } PreviousRow = ActiveRow; ActiveRow = vRowHistory.Pop(); OnRowSwitchedEvent.Invoke(pRowEntry); }
//////////////////////////////////////////////////////////////////////////////////////////////// /*--------------------------------------------------------------------------------------------*/ public void Start() { HovercastInterface cast = GetComponent <HovercastInterface>(); foreach (Transform childTx in cast.RowContainer) { HoverLayoutArcRow row = childTx.GetComponent <HoverLayoutArcRow>(); if (row != null && row != cast.ActiveRow) { childTx.gameObject.SetActive(false); } } }
/*--------------------------------------------------------------------------------------------*/ public void NavigateToRow(HoverLayoutArcRow pRow, HovercastRowSwitchingInfo.RowEntryType pRowEntry) { if (pRow == null) { Debug.LogError("Could not navigate to null/missing row."); return; } vRowHistory.Push(ActiveRow); //Debug.Log("Added row to history ("+vRowHistory.Count+"): "+ActiveRow, ActiveRow); PreviousRow = ActiveRow; ActiveRow = pRow; OnRowSwitchedEvent.Invoke(pRowEntry); }
/*--------------------------------------------------------------------------------------------*/ private void BuildRow(GameObject pRowGo, string pRowTitle) { pRowGo.AddComponent <TreeUpdater>(); HoverLayoutArcRow layoutArc = pRowGo.AddComponent <HoverLayoutArcRow>(); layoutArc.ArcDegrees = 90; HoverLayoutArcPaddingSettings layoutArcPad = layoutArc.Padding; layoutArcPad.Between = 0.15f; layoutArc.Padding = layoutArcPad; HovercastRowTitle title = pRowGo.AddComponent <HovercastRowTitle>(); title.RowTitle = pRowTitle; }
/*--------------------------------------------------------------------------------------------*/ public void Start() { PreviousRow = null; }