Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Game Mewarnai Tutorial
Thu Mar 23, 2017 10:21 am by kamil

» [ASK HELP] Slide informasi di augmented reality
Tue Jan 03, 2017 8:58 pm by Briyan_ap

» ASK cara klik dan memunculkan informasi
Tue Jan 03, 2017 8:54 pm by Briyan_ap

» [Ask] mengubah game PC menjadi game Android
Tue Jan 03, 2017 10:57 am by NiethaChan

» Virtualisasi suatu Gedung mengunakan unity3D + google seketchUP
Sat Dec 31, 2016 1:06 am by zeepank

» Minta Tolong, slideshow ngga muncul saat object di klik
Tue Dec 27, 2016 12:53 pm by Briyan_ap

» tolong dong lagi bikin button rotate tp button ga keluar
Wed Dec 21, 2016 1:15 pm by Lita Misae

» algoritma Minimax/negascout buat checkers
Wed Nov 30, 2016 1:51 am by ardiansa

» screenshot
Wed Nov 16, 2016 10:15 pm by azhari

Statistic

[ASK] Integrasi Scene

View previous topic View next topic Go down

[ASK] Integrasi Scene

Post  akbarpuryanto on Sun Mar 15, 2015 10:05 pm

permisi agan agan mau nanya.. saya punya 3 scene. misal tombol di scene 1 di klik maka akan masuk ke scene 2, dan ketika tombol di scene 2 di klik maka masuk scene 3. masalahnya pas tombol di scene 1 di klik masuk di scene 2 tapi otomatis pindah ke scene 3. gimana ya caranya biar ngga otomatis pindah ke scene 3.
mohon bantuannya agan agan
avatar
akbarpuryanto
Unity3D Newbie
Unity3D Newbie

Posts : 6
Points : 10
Reputation : 0
Join date : 2015-03-02

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  ahmad irfan on Mon Mar 16, 2015 12:18 am

bisa liat scriptnya gan..? barangkali ada yg salah dengan logika pemrogramannya.
avatar
ahmad irfan
Unity3D Newbie
Unity3D Newbie

Posts : 17
Points : 29
Reputation : 6
Join date : 2015-01-22
Age : 26
Location : Kota Tangerang

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  akbarpuryanto on Mon Mar 16, 2015 5:35 am

ahmad irfan wrote:bisa liat scriptnya gan..? barangkali ada yg salah dengan logika pemrogramannya.  

ini gan, script di scene 1
using UnityEngine;
using System.Collections;

public class Menu : MonoBehaviour, IButtonListener   {

//variable button
private Button buttonStart, buttonPanduan, buttonExit;




void Start() {
buttonStart = this.transform.FindChild("buttonStart").GetComponent<Button>();
buttonPanduan = this.transform.FindChild("buttonPanduan").GetComponent<Button>();
buttonExit = this.transform.FindChild("buttonExit").GetComponent<Button>();

buttonStart.RegisterListener(this);
buttonPanduan.RegisterListener(this);
buttonExit.RegisterListener(this);
}

public void OnButtonStateChange(Button changedButton, int buttonPhaseId) {
if (changedButton == buttonStart) {
Application.LoadLevel("menudua");
}

if(changedButton == buttonPanduan) {
Application.LoadLevel("panduan");
}
if (changedButton == buttonExit) {
Application.Quit();
}
}

void OnGUI(){

}
}


Last edited by akbarpuryanto on Mon Mar 16, 2015 5:40 am; edited 1 time in total
avatar
akbarpuryanto
Unity3D Newbie
Unity3D Newbie

Posts : 6
Points : 10
Reputation : 0
Join date : 2015-03-02

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  akbarpuryanto on Mon Mar 16, 2015 5:38 am

ahmad irfan wrote:bisa liat scriptnya gan..? barangkali ada yg salah dengan logika pemrogramannya.  

kalo yg ini di script scene 2 nya
using UnityEngine;
using System.Collections;

public class MenuDua : MonoBehaviour, IButtonListener {

//variable button
private Button btnBack, btnPerawatan, btnProduk;




void Start() {
btnBack = this.transform.FindChild("btnBack").GetComponent<Button>();
btnPerawatan = this.transform.FindChild("btnPerawatan").GetComponent<Button>();
btnProduk = this.transform.FindChild("btnProduk").GetComponent<Button>();

btnBack.RegisterListener(this);
btnPerawatan.RegisterListener(this);
btnProduk.RegisterListener(this);
}

public void OnButtonStateChange(Button changedButton, int buttonPhaseId) {
if (changedButton == btnBack) {
Application.LoadLevel("gamemenu");
}

if(changedButton == btnPerawatan) {
Application.LoadLevel("perawatan");
}
if (changedButton == btnProduk) {
Application.LoadLevel("produk");
}
}

void OnGUI(){

}
}
avatar
akbarpuryanto
Unity3D Newbie
Unity3D Newbie

Posts : 6
Points : 10
Reputation : 0
Join date : 2015-03-02

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  ahmad irfan on Mon Mar 16, 2015 11:15 pm

mmm pakai ibuttonlistener y. maaf sya blm pernah coba pakai script itu. tpi saya punya alternatif script lain. script ini saya dapat dari Brent Farris barangkali bisa membantu.

using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
public class ButtonMenuBelajar : MonoBehaviour {

public Rect button = new Rect (15,15,200,110); // ini untuk customize posisi dan size button
public string buttonLabel = "Load Level"; // ini untuk text labelnya.
public string levelToLoad = "Menu"; // ini untuk judul scene yang mau kamu tuju / load.

private void OnGUI ()
{
if (GUI.Button(button, buttonLabel))
Application.LoadLevel(levelToLoad);
}
}
avatar
ahmad irfan
Unity3D Newbie
Unity3D Newbie

Posts : 17
Points : 29
Reputation : 6
Join date : 2015-01-22
Age : 26
Location : Kota Tangerang

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  akbarpuryanto on Tue Mar 17, 2015 10:47 am

ahmad irfan wrote:mmm pakai ibuttonlistener y. maaf sya blm pernah coba pakai script itu. tpi saya punya alternatif script lain. script ini saya dapat dari Brent Farris barangkali bisa membantu.

using UnityEngine;
using System.Collections;

[ExecuteInEditMode]
public class ButtonMenuBelajar : MonoBehaviour {

public Rect button = new Rect (15,15,200,110); // ini untuk customize posisi dan size button
public string buttonLabel = "Load Level"; // ini untuk text labelnya.
public string levelToLoad = "Menu"; // ini untuk judul scene yang mau kamu tuju / load.

private void OnGUI ()
{
if (GUI.Button(button, buttonLabel))
Application.LoadLevel(levelToLoad);
}
}

makasih banget gan Very Happy Very Happy .. tapi biar tiap button ada texturenya gmna ya gan scriptnya? biar ngga polos
avatar
akbarpuryanto
Unity3D Newbie
Unity3D Newbie

Posts : 6
Points : 10
Reputation : 0
Join date : 2015-03-02

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  ahmad irfan on Tue Mar 17, 2015 11:40 am

untuk pemberian texturenya agan bsa liat di video ini.

https://www.youtube.com/watch?v=kNsD90Gjs-g

beberapa script perlu diperhatikan untuk bsa berinteraksi satu dengan yang lainnya. pasti bsa. smngat..! Cool
avatar
ahmad irfan
Unity3D Newbie
Unity3D Newbie

Posts : 17
Points : 29
Reputation : 6
Join date : 2015-01-22
Age : 26
Location : Kota Tangerang

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  akbarpuryanto on Tue Mar 17, 2015 1:37 pm

ahmad irfan wrote:untuk pemberian texturenya agan bsa liat di video ini.

https://www.youtube.com/watch?v=kNsD90Gjs-g

beberapa script perlu diperhatikan untuk bsa berinteraksi satu dengan yang lainnya. pasti bsa. smngat..! Cool

siapp gan, mksih banyak gan Very Happy
avatar
akbarpuryanto
Unity3D Newbie
Unity3D Newbie

Posts : 6
Points : 10
Reputation : 0
Join date : 2015-03-02

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  ahmad irfan on Tue Mar 17, 2015 4:23 pm

SAMA2 Very Happy
avatar
ahmad irfan
Unity3D Newbie
Unity3D Newbie

Posts : 17
Points : 29
Reputation : 6
Join date : 2015-01-22
Age : 26
Location : Kota Tangerang

View user profile

Back to top Go down

Re: [ASK] Integrasi Scene

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum