Added controls for gamepad, changed input & UI
This commit is contained in:
@@ -22,6 +22,7 @@ namespace Assets.Scripts.Menu
|
||||
characterCreation.SetActive(false);
|
||||
mainMenu.SetActive(true);
|
||||
SteamWorksHandler.getStandardAchievement("StartAchievement");
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnStart"));
|
||||
}
|
||||
|
||||
public void startGame(SceneHandler sceneHandler)
|
||||
@@ -96,12 +97,14 @@ namespace Assets.Scripts.Menu
|
||||
{
|
||||
characterCreation.SetActive(true);
|
||||
mainMenu.SetActive(false);
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("inName"));
|
||||
}
|
||||
|
||||
public void closeCharacterCreation()
|
||||
{
|
||||
characterCreation.SetActive(false);
|
||||
mainMenu.SetActive(true);
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnStart"));
|
||||
}
|
||||
|
||||
public void openOptions()
|
||||
@@ -109,13 +112,15 @@ namespace Assets.Scripts.Menu
|
||||
options.SetActive(true);
|
||||
mainMenu.SetActive(false);
|
||||
FileHandler.loadOptionDisplay();
|
||||
GameObject.Find("ScrollbarOptions").GetComponent<Scrollbar>().value = 1f;
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnAudio"));
|
||||
showOptionView("audio");
|
||||
}
|
||||
|
||||
public void closeOptions()
|
||||
{
|
||||
options.SetActive(false);
|
||||
mainMenu.SetActive(true);
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnStart"));
|
||||
}
|
||||
|
||||
public string saveVideoSettings(){
|
||||
@@ -181,5 +186,21 @@ namespace Assets.Scripts.Menu
|
||||
PlayerPrefs.SetInt("isLoad", 1);
|
||||
sceneHandler.openGameScene();
|
||||
}
|
||||
|
||||
public bool isCharacterCreation(){
|
||||
return characterCreation.activeSelf;
|
||||
}
|
||||
|
||||
public void showOptionView(string key){
|
||||
GameObject optionContent = GameObject.Find("pnlContent");
|
||||
for(int i = 0; i < optionContent.transform.childCount; i++){
|
||||
if(optionContent.transform.GetChild(i).name.ToLower().Contains(key)){
|
||||
optionContent.transform.GetChild(i).transform.localScale = new Vector3(1,1,1);
|
||||
}
|
||||
else{
|
||||
optionContent.transform.GetChild(i).transform.localScale = new Vector3(0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user