Log in or register to post comments

(ASK) Adding Button on AR Camera

July 5, 2015 - 2:29am #1

Excuse me sir,

Im creating main menu for augmented reality apps , and when start button clicked it goes to AR Camera (it works fine)

 

my question is how to go from AR Camera to main menu scene?
(my ar camera is on loadlevel(2) and main menu on loadlevel(1)

im trying to write this C# script but it didnt work (The button appears but didnt work)

 

using UnityEngine;
using System.Collections;

public class ARMenu : MonoBehaviour {

    public GUISkin guiSkin;
    public float guiRatio;
    public float sWidth;
    public Vector3 GUIsF;
    
    void Awake(){
        sWidth = Screen.width;
        guiRatio = sWidth/1920;
        GUIsF = new Vector3(guiRatio,guiRatio,1);
    }
    
    void OnGUI(){
        GUI.skin = guiSkin;
        back ();
    
    }
    void back() {
        GUI.matrix = Matrix4x4.TRS(new Vector3(Screen.width - 258*GUIsF.x,GUIsF.y,0),Quaternion.identity,GUIsF);

        if(statusback==false) {
            if (GUI.Button (new Rect (-208, 10, 238, 59), "back")) {
                statusback==true;
            }
        }

        if (GUI.Button (new Rect (40, 10, 208, 59), "Quit")) {
            Application.Quit();
        }
    }
    void Update(){
        if (statusback == true) {
            Application.LoadLevel(1);
        }
    }
}

Thanks for helping

AttachmentSize
Image icon skrips.jpg68.1 KB

(ASK) Adding Button on AR Camera

November 29, 2015 - 10:13pm #2

Please reply this, i got this problem too :(

Log in or register to post comments