57
DAFTAR PUSTAKA
Andi. 2014. Mudah Menuat Game 3 Dimensi Menggunakan Unity 3D, Penerbit ANDI Yogyakarta dengan WAHANA KOMPUTER Semarang.
Anonim. 2014. uml-diagram. http://www.uml-diagrams.org. Diakses pada tanggal 20 Juni 2015.
Anonim. 2015. Pengertian Augmented Reality. http://www.it-jurnal.com. Diakses pada tanggal 12 Maret 2015.
Apress. 2012. Pro Android Augmented Reality by Raghav Sood. http://itebooks.info.
Diakses pada tanggal 30 Juni 2015.
Developer vuforia. 2015. Pembuatan Database Marker. www.developer.vuforia.com.
Diakses pada tanggal 4 April 2015.
Hendratman, Hendi. 2015. The Magic Of Blender 3d Modelling, Bandung : Penerbit Informatika.
Packt Publishing. 2012. Augmented Reality usung Appcelerator Titanium Starter by Trevor Ward. http://it-ebooks.info. Diakses pada tanggal 30 Juni 2015.
Prasetyo, Edy. 2015. Metode Modeling 3d. http://zlatanprasetyo.blogspot.com.
Diakses pada tanggal 31 Juli 2015.
Raharjo, Budi. 2015. Mudah Belajar C#, Bandung : Penerbit Informatika.
Roedavan, Rickman. 2014. Unity Tutorial Game Engine, Bandung : Penerbit Informatika.
Safaat H, Nazruddin. 2011. Pemrograman Aplikasi Mobile Smartphone dan Tablet PC Berbasis Androd, Bandung : Penerbit INFORMATIKA.
Sifat-ku. 2013. Konsep Dasar Pemodelan 3d. http://sikat-ku.blogspot.com. Diakses pada tanggal 31 Juli 2015.
Tim Polindra. 2013. Panduan Pelaksanaan Tugas Akhir Program Diploma 3.
Politeknik Negeri Indramayu.
Wrox. 2011. Professional Augmented Reality Browsers for Smartphones by Lester
Madden. http://it-ebooks.info. Diakses pada tanggal 30 Juni 2015
LAMPIRAN
Lampiran 1 : Script Background
using UnityEngine;
using System.Collections;
public class background_menu : MonoBehaviour {
public Texture backgroundTexture;
void OnGUI(){
GUI.DrawTexture(new
Rect(0,0,Screen.width,Screen.height),backgroundTexture);
} }
Lampiran 2 : Script Menu Utama
using UnityEngine;
using System.Collections;
public class mainmenu : MonoBehaviour { public GUISkin guiSkin;
public Texture menuar;
public Texture petunjuk;
public Texture pembuat;
public Texture keluar;
void OnGUI(){
GUI.skin = guiSkin;
GUI.Box (new Rect (new Rect (Screen.width / 2.8f, Screen.height /3.8f, Screen.width / 3.5f, Screen.height / 1.70f)),
"Main Menu");
if (GUI.Button (new Rect (Screen.width/2.5f,
Screen.height/2.55f, Screen.width/5, Screen.height/10), "MENU AR")) {
Application.LoadLevel (1);
}
if (GUI.Button (new Rect (Screen.width/2.5f,
Screen.height/2, Screen.width/5, Screen.height/10), "PETUNJUK")) { Application.LoadLevel (2);
}
if (GUI.Button (new Rect (Screen.width/2.5f,
Screen.height/1.65f, Screen.width/5, Screen.height/10), "PEMBUAT")) {
Application.LoadLevel(3);
}
if (GUI.Button (new Rect (Screen.width/2.5f,
Screen.height/1.40f, Screen.width/5, Screen.height/10), "KELUAR")) {
Application.Quit();
} }
}
Lampiran 3 : Script Trackable menampilkan obyek 3D
using UnityEngine;
using System.Collections;
public class Target1 : MonoBehaviour, ITrackableEventHandler { private TrackableBehaviour mTrackableBehaviour;
private float guiRatio;
private float sWidth;
private Vector3 GUIsF;
public Texture2D icon;
public Texture2D icon2;
public Texture2D icon3;
public Texture2D icon4;
public int baru4;
public AudioClip myClip;
public Texture2D sound1;
public Texture2D sound2;
public bool sound = false;
private bool mShowGUIButton = false;
private Rect mButtonRect1 = new Rect(50,10,80,80);
private Rect mButtonRect2 = new Rect(50,10,80,80);
private Rect mButtonRect3 = new Rect(150,10,80,80);
private Rect mButtonRect4 = new Rect(250,10,80,80);
private Rect mButtonRect5 = new Rect(550,10,80,80);
private Rect mButtonRect6 = new Rect(550,10,80,80);
public GameObject CARDNL;
public float kecepatanRotasi =60f;
bool statusRotasi = false;
void Awake(){
sWidth = Screen.width;
guiRatio = sWidth / 1920;
GUIsF = new Vector3 (guiRatio, guiRatio, 1);
}
void Start () {
mTrackableBehaviour = GetComponent<TrackableBehaviour>();
if (mTrackableBehaviour) {
mTrackableBehaviour.RegisterTrackableEventHandler(this);
} }
public void OnTrackableStateChanged(
TrackableBehaviour.Status previousStatus, TrackableBehaviour.Status newStatus) {
if (newStatus == TrackableBehaviour.Status.DETECTED ||
newStatus == TrackableBehaviour.Status.TRACKED) {
mShowGUIButton = true;
} else {
mShowGUIButton = false;
} }
void OnGUI() {
CaptureRotasi ();
//Informasi ();
}
void CaptureRotasi(){
if (mShowGUIButton) {
//GUI.matrix = Matrix4x4.TRS (new Vector3 (GUIsF.x, GUIsF.y, 0), Quaternion.identity, GUIsF);
if (statusRotasi == false) {
if (GUI.Button (mButtonRect1,icon2,
"Rotasi")) {
statusRotasi = true;
} } else
if (mShowGUIButton) {
if (GUI.Button (mButtonRect2,icon3, "Stop Rotasi")) {
statusRotasi = false;
} }
if (mShowGUIButton) {
if (GUI.Button (mButtonRect3,icon,
"Capture")) {
baru4++;
string filename = baru4+"foto.png";
Application.CaptureScreenshot(filename);
if (QCARRuntimeUtilities.IsPlayMode()) {
// if in PlayMode, the screenshot will be saved
// to the project directory Debug.Log ("Saved screenshot to
" + filename);
} else {
// if running on Device, the screenshot will be saved
// to the Application.persistentDataPath directory
Debug.Log ("Saved screenshot to
" + Application.persistentDataPath + "/" + filename);
} }
}
if (sound == false){
if (GUI.Button (mButtonRect5,sound1,
"Sound")) {
this.gameObject.AddComponent<AudioSource> ();
this.GetComponent<AudioSource>
().clip = myClip;
this.GetComponent<AudioSource>
().Play ();
sound = true;
} }else
if (mShowGUIButton) {
if (GUI.Button (mButtonRect6,sound2,
"off")) {
this.gameObject.AddComponent<AudioSource> ();
this.GetComponent<AudioSource>
().clip = myClip;
this.GetComponent<AudioSource>
().Stop ();
sound = false;
} }
if (GUI.Button (mButtonRect4,icon4, "Kembali")) { Application.LoadLevel(0);
} }
}
void Update(){
if (statusRotasi == true){
CARDNL.transform.Rotate(Vector3.up, kecepatanRotasi * Time.deltaTime);
} }
}
Lampiran 4 : Script Menampilkan Tombol Informasi
using UnityEngine;
using System.Collections;
public class CARDNL : MonoBehaviour { public Transform target1;
public bool show = false;
public bool ilang = false;
public Texture sound1;
public Texture sound2;
public AudioClip myClip;
void Update(){
if (Input.GetMouseButton (0)) {
Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast (ray, out hit)) { if (hit.transform == target1) {
//show = true;
ilang = true;
} }
} }
void OnGUI(){
if (ilang == true) {
if (show == false) {
if (GUI.Button (new Rect (60, 90, 80, 80), sound1)) {
this.gameObject.AddComponent<AudioSource> ();
this.GetComponent<AudioSource>
().clip = myClip;
this.GetComponent<AudioSource>
().Play ();
show = true;
ilang = true;
} } else
if (show == true) {
if (GUI.Button (new Rect (60, 90, 80, 80), sound2)) {
this.gameObject.AddComponent<AudioSource> ();
this.GetComponent<AudioSource>
().clip = myClip;
this.GetComponent<AudioSource>
().Stop ();
ilang = false;
show = false;
} }
} }
Lampiran 5 : Script Virtual Button
using UnityEngine;
using System.Collections;
public class VirtualButtonLumba : MonoBehaviour, IVirtualButtonEventHandler {
public GameObject DOLPHIN;
void Start() {
VirtualButtonBehaviour[] vbs =
GetComponentsInChildren<VirtualButtonBehaviour> ();
for (int i = 0; i < vbs.Length; ++i) {
vbs [i].RegisterEventHandler (this);
}
//cari object whale
DOLPHIN = transform.FindChild ("DOLPHIN").gameObject;
}
//button di tekan
public void OnButtonPressed(VirtualButtonAbstractBehaviour vb)
{
switch (vb.VirtualButtonName) { case "lumba":
DOLPHIN.animation.Play ();
break;
} }
//button di lepas
public void OnButtonReleased(VirtualButtonAbstractBehaviour vb){
switch (vb.VirtualButtonName) { case "lumba":
DOLPHIN.animation.Stop ();
break;
} }
}
Lampiran 6 : Script Menu Panduan
using UnityEngine;
using System.Collections;
public class panduan : MonoBehaviour {
public Texture Gambar1,Gambar2,Gambar3;
public Texture2D kembali;
public Vector2 scrollPosition1 = Vector2.zero;
public bool show=false;
void OnGUI(){
if(show==true) {
GUI.BeginGroup (new Rect (Screen.width / 3 - 50, Screen.height / 2 - 250, 800, 500));
GUI.Box (new Rect (-20, 70, 505, 380),
"Informasi");
if (GUI.Button (new Rect (35, 460, 487, 25),kembali, "Kembali"))
{
Application.LoadLevel(0);
}
scrollPosition1 = GUI.BeginScrollView(new Rect(20,10,450,420),scrollPosition1,new Rect(20,10,1420,200));
GUI.DrawTexture (new Rect (20, 100, 450, 310), Gambar1);
//info1 = GUI.TextArea(new Rect(0,300,350,50),info1,200);
GUI.DrawTexture(new Rect(500,100,450,310),Gambar2);
//info2 = GUI.TextArea(new Rect(400,300,350,50),info2,200);
GUI.DrawTexture(new Rect(980,100,450,310),Gambar3);
//info3 = GUI.TextArea(new Rect(800,300,350,50),info3,200);
GUI.EndScrollView();
GUI.EndGroup();
}
//if(GUI.Button(new
Rect(Screen.width/2.5f,Screen.height/2,Screen.width/5,Screen.height /10), "InfoKlik"))
} }
Lampiran 7 : Script Menu Pembuat
using UnityEngine;
using System.Collections;
public class About : MonoBehaviour { public Texture Gambar1;
public Texture2D kembali;
public bool show = false;
void OnGUI(){
//baris,kolom,panjang,lebar if (show == false) {
GUI.BeginGroup (new Rect (Screen.width / 3 - 50, Screen.height / 2 - 250, 800, 500));
GUI.Box (new Rect (-20, 70, 505, 380), "About Us");
if (GUI.Button (new Rect (35, 460, 487, 25),kembali, "Kembali"))
{
Application.LoadLevel (0);
}
GUI.DrawTexture (new Rect (20, 100, 450, 310), Gambar1);
GUI.EndGroup ();
} }
}