Welcome, Guest

Author Topic: How do I get the current URL of the view?  (Read 1733 times)

Hristo

  • Administrator
  • *****
  • Posts: 577
    • View Profile
How do I get the current URL of the view?
« on: April 14, 2014, 06:30:15 AM »
To get the current URL of the view just use the "Page" property of the view.

To test it attach the sample code below to a gameobject that has a Coherent UI view. When started it will print the current URL of the View.

Code: [Select]
using UnityEngine;
using System.Collections;

public class Page : MonoBehaviour {

void Start ()
{
var m_view = GetComponent<CoherentUIView>(); 
var page = m_view.Page;
Debug.Log("The current page is:" + page);
}

}
« Last Edit: April 14, 2014, 06:40:36 AM by Hristo »

Tags: