Develop car selection menu in unity easy tutorial

Subscribers:
1,110
Published on ● Video Link: https://www.youtube.com/watch?v=NxlwY3hIyAY



Category:
Tutorial
Duration: 4:35
676 views
26


ASSALAM o alaikum Code :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CarSelection : MonoBehaviour
{
public GameObject[] allVehicles;
public int currentVehicle = 0;

// Start is called before the first frame update
void Start()
{

}

public void SelectNext()
{


allVehicles[currentVehicle].SetActive(false);
currentVehicle++;
currentVehicle = currentVehicle % allVehicles.Length;
allVehicles[currentVehicle].SetActive(true);
}

public void SelectPrevious()
{
allVehicles[currentVehicle].SetActive(false);
currentVehicle--;

if (currentVehicle "less than sign" 0)
{
currentVehicle = allVehicles.Length - 1;
}

allVehicles[currentVehicle].SetActive(true);

}
}


/////////////////////////////////////////////////////////////////////////////////////////////


Safar by ASHUTOSH
-----------------------------------------------------------------------------------------------------------------------------------
Track: ASHUTOSH - Time
https://soundcloud.com/grandakt
-------------------------------------------------------------------------------------------------------------------------------------
FREE DOWNLOAD:- https://soundcloud.com/grandakt/safar-produced-by-ashutosh-free-download
ASSALAM o alaikum
All codes and concepts and videos from this channel are non copyrighted and free to use because we believe that knowledge should be freely available for everyone
But kindly give those people crdeit whom I have given in description if you use their work
/////////////////////////////////////////////////////////////////////////////////////////////







Tags:
unity
unity3d
unity tutorials
learn unity
unity coding
unity programming
car selection menu
car selection menu in unity
develop car selection menu in unity