Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/jackmawer/JacksWorld. An abandoned mini-project that I created while learning to use Unity with networking.
Something went wrong. Try again.
814 B · 31 lines
C#
at master
1234567891011121314151617181920212223242526272829303132using UnityEngine;using System.Collections;
/// <summary>/// This component makes it easy to switch scenes or open webpages on click./// Requires a InputToEvent component on the camera to forward clicks on screen./// </summary>public class OnClickLoadSomething : MonoBehaviour{ public enum ResourceTypeOption : byte { Scene, Web }
public ResourceTypeOption ResourceTypeToLoad = ResourceTypeOption.Scene; public string ResourceToLoad;
public void OnClick() { switch (ResourceTypeToLoad) { case ResourceTypeOption.Scene: Application.LoadLevel(ResourceToLoad); break; case ResourceTypeOption.Web: Application.OpenURL(ResourceToLoad); break; } }}