Initial checkin
Initial checkin of Quest App Launcher
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class OnInteraction : MonoBehaviour
|
||||
{
|
||||
protected Material oldHoverMat;
|
||||
public Material yellowMat;
|
||||
public Material backIdle;
|
||||
public Material backACtive;
|
||||
public UnityEngine.UI.Text outText;
|
||||
|
||||
public void OnHoverEnter(Transform t)
|
||||
{
|
||||
var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry;
|
||||
if (null != appEntry)
|
||||
{
|
||||
// Enable border
|
||||
EnableBorder(t, true);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnHoverExit(Transform t)
|
||||
{
|
||||
var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry;
|
||||
if (null != appEntry)
|
||||
{
|
||||
// Disable border
|
||||
EnableBorder(t, false);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnSelected(Transform t)
|
||||
{
|
||||
var appEntry = t.gameObject.GetComponent("AppEntry") as AppEntry;
|
||||
if (null != appEntry)
|
||||
{
|
||||
// Launch app
|
||||
Debug.Log("Launching: " + appEntry.appName + " (package id: " + appEntry.packageId + ")");
|
||||
QuestAppLauncher.GridPopulation.LaunchApp(appEntry.packageId);
|
||||
}
|
||||
}
|
||||
|
||||
void EnableBorder(Transform t, bool enable)
|
||||
{
|
||||
var border = t.Find("Border");
|
||||
border?.gameObject.SetActive(enable);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user