LISTING PROGRAM
1.
Fungsi Splashscreen
using UnityEngine;
using System.Collections;
public class splashscreen : MonoBehaviour {
public float timer =4; // waktu delay public void Update(){
timer -= Time.deltaTime; // hitung mundur if (timer > 0){
Debug.Log(timer); }else {
Application.LoadLevel(1); // jika timer < 0 maka akan secara otomatis berpindah ke Main Menu Aplikasi (LoadLevel(1))
} }
}
2.
Fungsi Main Menu
using UnityEngine;
using System.Collections;
public class menu : MonoBehaviour {
public void KeluarAplikasi(string KeluarAplikasi) {
Application.Quit(); }
public void scan(string scan) {
Application.LoadLevel(2); }
A-2
3.
Fungsi About
using UnityEngine;
using System.Collections;
public class popup : MonoBehaviour { public Canvas PilihCanvas; public bool show = false;
public void Showpopup() {
if(show == true){ show = false;
PilihCanvas.enabled = false; }
else if (show == false){ show = true;
PilihCanvas.enabled = true; }
}
}
4.
Fungsi Rotate
using UnityEngine;
using System.Collections; using System.IO;
public class rotaterepeat : MonoBehaviour {
public float scalingSpeed = 0.03f; public float rotationSpeed = 70.0f; public float translationSpeed = 5.0f; // public GameObject Model;
bool repeatRotateRight = false;
void Update () {
}
public void CloseAppButton () {
Application.Quit (); }
public void RotationRightButton () {
// transform.Rotate (0, -rotationSpeed * Time.deltaTime, 0);
GameObject.FindWithTag("Model")
.transform.Rotate(0, -rotationSpeed * Time.deltaTime, 0);
}
public void RotationRightButtonRepeat () {
// transform.Rotate (0, -rotationSpeed * Time.deltaTime, 0);
repeatRotateRight=true; }
public void RotateRightButtonOff () {
repeatRotateRight = false; Debug.Log ("Off");
}
public void AnyButton () {
Debug.Log ("Any"); }
}
5.
Fungsi Zoom
using UnityEngine;
using System.Collections;
public class zoom : MonoBehaviour {
A-4
public GameObject objek1,objek2,objek3,objek4,objek5; // objek yang akan di zoom
public GUIStyle backgroundstyle; public GUIStyle thumbstyle;
//Inisialisasi void Start () {
nilaiI = 1f; }
// pemanggilan perfame void Update () {
objek1.transform.localScale = new Vector3(0.023f, 0.023f, 0.023f) * nilaiI * 1f; //pengaturan ukuran objek dan interval perubahan slider
objek2.transform.localScale = new Vector3(0.04f, 0.04f, 0.04f) * nilaiI * 1f;
objek3.transform.localScale = new Vector3(0.0163f, 0.0163f, 0.0163f) * nilaiI * 1f;
objek4.transform.localScale = new Vector3(0.0320f, 0.0320f, 0.0320f) * nilaiI * 1f;
objek5.transform.localScale = new Vector3(0.0245f, 0.0245f, 0.0245f) * nilaiI * 1f;
}
void OnGUI() //untuk menampilkan GUI slider {
nilaiI = GUI.VerticalSlider (new Rect(100, 150, 500, 500) , nilaiI, 3.0f,1f, backgroundstyle, thumbstyle);