Creating Canvas and Menu Button

 Creating Canvas and Menu Button

 - background Image for Canvas

Open Any project you created - > 

File New Scene and Save it as a file

Right Click on hierarchy -> UI -> Canvas   Create Raw image inside Canvas || Right Click -> UI-> Raw Image

drag Image to raw Image -> Inspector -> Raw image target

Set Image using transform tool

For Crating the Text -> Right Click ->< UI -> Text

Design UI Buttons - Right Click -> UI -> Button

Programming UI Buttons

First Go to Build Setting Add Both Scene -> Make sure Menu Scene is on the top

create a C# Script -> Name ChangeScene 

Add

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class ChangeScene : MonoBehaviour
{
    public void LoadARScene()
    {
        SceneManager.LoadScene("AR_GreetingCard");
    }

    public void ExitApp()
    {
        Application.Quit();
    }
}

Create a Empty Object and Attach the script to object

Open  Button You Crated -> In side OnClick() -> Attach the Empty Object and Select function LoadARScene()

Same For Exit Also Select -> ExitApp()







Comments