June 2017
Beginner to intermediate
336 pages
8h 44m
English
The panel is ready and data binding is also completed; the next part would be invoking it when we are tapping it on any of the floors. We have already created the method definition for OnInputClicked(), which is invoked when there is an Air Tap. Update the method with the following line of code:
public void OnInputClicked(InputEventData eventData) { GameObject detailsPanel = GameObject.FindWithTag("DetailsPanel"); CanvasGroup detailsPanelRenderer = detailsPanel.GetComponentInChildren<CanvasGroup>(); if (detailsPanelRenderer.alpha == 1) detailsPanelRenderer.alpha = 0; else detailsPanelRenderer.alpha = 1; }
When an Air tap is done, first it takes the references for the DetialsPanel and finds the renderer for CanvasGroup ...
Read now
Unlock full access