public void Load (string id, View view) { if (activeContainer == null) { // Initialize if this is the first time loading a view activeContainer = container1; activeContainer.LoadView (id, view); activeContainer.SetInputEnabled (); inactiveContainer = container2; inactiveContainer.RectTransform.SetAnchoredPositionX (canvasWidth); } else { inactiveContainer.LoadView (id, view); // Trigger the slide animation // If the new screen and previous screen have a transition override specified, use that // Otherwise, use the default behaviour bool slideIn; if (transitionOverrides.TryGetValue (prevId + " " + id, out slideIn)) { if (slideIn) { SlideIn (); } else { SlideOut (); } } else { if (inactiveContainer.TemplateIsBefore (id, prevId)) { SlideOut (); } else { SlideIn (); } } } prevId = id; }
public void LoadView (string id, View view) { content = GetTemplateById (id); content.gameObject.SetActive (true); ApplySettings (content.Settings); content.LoadView (view, OverlayElements); }
/// <summary> /// Load the template with the id and apply the view /// </summary> public void Load (string id, View view) { templatesContainer.Load (id, view); }