DocLinkButton.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // --------------------------------------------------------------------------------------------------------------------
  2. // <copyright file="DocLinkButton.cs" company="Exit Games GmbH">
  3. // Part of: Pun demos
  4. // </copyright>
  5. // <author>developer@exitgames.com</author>
  6. // --------------------------------------------------------------------------------------------------------------------
  7. using Photon.Pun.Demo.Shared;
  8. using UnityEngine;
  9. using UnityEngine.EventSystems;
  10. namespace Photon.Pun.Demo.Cockpit
  11. {
  12. /// <summary>
  13. /// Open an Url on Pointer Click.
  14. /// </summary>
  15. public class DocLinkButton : MonoBehaviour, IPointerClickHandler
  16. {
  17. public DocLinks.DocTypes Type = DocLinks.DocTypes.Doc;
  18. public string Reference = "getting-started/pun-intro";
  19. // Just so that Unity expose the enable Check Box inside the Component Inspector Header.
  20. public void Start(){}
  21. //Detect if a click occurs
  22. public void OnPointerClick(PointerEventData pointerEventData)
  23. {
  24. Application.OpenURL(DocLinks.GetLink(Type,Reference));
  25. }
  26. }
  27. }