Implementasi Augmented Reality Pada Alat Musik Bonang Jawa Berbasis Android
LISTING PROGRAM
Source Code Tbl_Script.cs
using UnityEngine;
using System.Collections;
public class Tbl_Script : MonoBehaviour {
public void TblStart (int Menu) {
Application.LoadLevel (Menu);
}
public void TblBack (int home) {
Application.LoadLevel (home);
}
public void TblTentang (int tentang) {
Application.LoadLevel (tentang);
}
public void TblMain (int Main) {
Application.LoadLevel (Main);
}
public void TblInfo (int info) {
Application.LoadLevel (info);
}
public void TblTutorial (int tutorial) {
Application.LoadLevel (tutorial);
}
public void TblPetunjuk (int petunjuk) {
Application.LoadLevel (petunjuk);
}
public void TblBack1 (int menu) {
Application.LoadLevel (menu);
}
public void TblBack2 (int pilihan) {
Application.LoadLevel (pilihan);
}
public void TblPilihan(int pilihan) {
Application.LoadLevel (pilihan);
}
public void TblAR (int AR) {
Application.LoadLevel (AR);
}
}
Source Code Keluar.cs
using UnityEngine;
using System.Collections;
public class keluar : MonoBehaviour {
public void ExitApplication()
{
ExitApplication();
}
}
Source Code Marker.cs
using UnityEngine;
using System.Collections;
public class marker : MonoBehaviour {
public void unduh (){
Application.OpenURL
("https://drive.google.com/file/d/0B25p_FPCHTVmaEt5RFY4Mn
BHeEE/view?usp=sharing");
}
}
Source Code VirtualButtonEventHandler.cs
using UnityEngine;
using System.Collections.Generic;
using Vuforia;
public class VirtualButtonEventHandler : MonoBehaviour,
IVirtualButtonEventHandler {
public AudioSource Sound;
public AudioSource Sound1;
public AudioSource Sound2;
public AudioSource Sound3;
public AudioSource Sound4;
public AudioSource Sound5;
public AudioSource Sound6;
public AudioSource Sound7;
public AudioSource Sound8;
public AudioSource Sound9;
void Start() {
// Search for all Children from this ImageTarget with
type VirtualButtonBehaviour
VirtualButtonBehaviour[] vbs =
GetComponentsInChildren();
for (int i = 0; i < vbs.Length; i++) {
// Register with the virtual buttons
TrackableBehaviour
vbs[i].RegisterEventHandler(this);
}
public void
OnButtonPressed(VirtualButtonAbstractBehaviour vb) {
//Debug.Log(vb.VirtualButtonName);
Debug.Log("Button pressed!");
//AudioSource audio =
GetComponent();
//audio.Play();
switch(vb.VirtualButtonName) {
case "markseam":
Sound.Play();
break;
case "markseam1":
Sound1.Play();
break;
case "markseam2":
Sound2.Play();
break;
default:
case "markseam3":
Sound3.Play();
break;
case "markseam4":
Sound4.Play();
break;
case "markseam5":
Sound5.Play();
break;
case "markseam6":
Sound6.Play();
break;
case "markseam7":
Sound7.Play();
break;
case "markseam8":
Sound8.Play();
break;
case "markseam9":
Sound9.Play();
break;
throw new UnityException("Button not
supported: " + vb.VirtualButtonName);
break;
}
}
// Called when the virtual button has just been released:
public void
OnButtonReleased(VirtualButtonAbstractBehaviour vb) {
Debug.Log("Button released!");
}
}
Source Code Tbl_Script.cs
using UnityEngine;
using System.Collections;
public class Tbl_Script : MonoBehaviour {
public void TblStart (int Menu) {
Application.LoadLevel (Menu);
}
public void TblBack (int home) {
Application.LoadLevel (home);
}
public void TblTentang (int tentang) {
Application.LoadLevel (tentang);
}
public void TblMain (int Main) {
Application.LoadLevel (Main);
}
public void TblInfo (int info) {
Application.LoadLevel (info);
}
public void TblTutorial (int tutorial) {
Application.LoadLevel (tutorial);
}
public void TblPetunjuk (int petunjuk) {
Application.LoadLevel (petunjuk);
}
public void TblBack1 (int menu) {
Application.LoadLevel (menu);
}
public void TblBack2 (int pilihan) {
Application.LoadLevel (pilihan);
}
public void TblPilihan(int pilihan) {
Application.LoadLevel (pilihan);
}
public void TblAR (int AR) {
Application.LoadLevel (AR);
}
}
Source Code Keluar.cs
using UnityEngine;
using System.Collections;
public class keluar : MonoBehaviour {
public void ExitApplication()
{
ExitApplication();
}
}
Source Code Marker.cs
using UnityEngine;
using System.Collections;
public class marker : MonoBehaviour {
public void unduh (){
Application.OpenURL
("https://drive.google.com/file/d/0B25p_FPCHTVmaEt5RFY4Mn
BHeEE/view?usp=sharing");
}
}
Source Code VirtualButtonEventHandler.cs
using UnityEngine;
using System.Collections.Generic;
using Vuforia;
public class VirtualButtonEventHandler : MonoBehaviour,
IVirtualButtonEventHandler {
public AudioSource Sound;
public AudioSource Sound1;
public AudioSource Sound2;
public AudioSource Sound3;
public AudioSource Sound4;
public AudioSource Sound5;
public AudioSource Sound6;
public AudioSource Sound7;
public AudioSource Sound8;
public AudioSource Sound9;
void Start() {
// Search for all Children from this ImageTarget with
type VirtualButtonBehaviour
VirtualButtonBehaviour[] vbs =
GetComponentsInChildren();
for (int i = 0; i < vbs.Length; i++) {
// Register with the virtual buttons
TrackableBehaviour
vbs[i].RegisterEventHandler(this);
}
public void
OnButtonPressed(VirtualButtonAbstractBehaviour vb) {
//Debug.Log(vb.VirtualButtonName);
Debug.Log("Button pressed!");
//AudioSource audio =
GetComponent();
//audio.Play();
switch(vb.VirtualButtonName) {
case "markseam":
Sound.Play();
break;
case "markseam1":
Sound1.Play();
break;
case "markseam2":
Sound2.Play();
break;
default:
case "markseam3":
Sound3.Play();
break;
case "markseam4":
Sound4.Play();
break;
case "markseam5":
Sound5.Play();
break;
case "markseam6":
Sound6.Play();
break;
case "markseam7":
Sound7.Play();
break;
case "markseam8":
Sound8.Play();
break;
case "markseam9":
Sound9.Play();
break;
throw new UnityException("Button not
supported: " + vb.VirtualButtonName);
break;
}
}
// Called when the virtual button has just been released:
public void
OnButtonReleased(VirtualButtonAbstractBehaviour vb) {
Debug.Log("Button released!");
}
}