Reworked menu and achievements
This commit is contained in:
@@ -20,9 +20,9 @@ namespace Assets.Scripts.Menu
|
||||
void Start()
|
||||
{
|
||||
FileHandler.loadOptions(false);
|
||||
options.transform.localScale = new Vector3(0,0,0);
|
||||
characterCreation.transform.localScale = new Vector3(0,0,0);
|
||||
SteamWorksHandler.getStandardAchievement("StartAchievement");
|
||||
options.transform.localScale = new Vector3(0, 0, 0);
|
||||
characterCreation.transform.localScale = new Vector3(0, 0, 0);
|
||||
SteamWorksHandler.getFirstPlayAchievement();
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnStart"));
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ namespace Assets.Scripts.Menu
|
||||
PlayerPrefs.SetString("playername", GameObject.Find("inName").GetComponent<InputField>().text);
|
||||
PlayerPrefs.SetInt("difficulty", GameObject.Find("dropDifficulty").GetComponent<Dropdown>().value);
|
||||
PlayerPrefs.SetInt("isLoad", 0);
|
||||
SteamWorksHandler.getStandardAchievement("CharAchievement");
|
||||
sceneHandler.openGameScene();
|
||||
}
|
||||
|
||||
@@ -84,22 +83,22 @@ namespace Assets.Scripts.Menu
|
||||
|
||||
public void openCharacterCreation()
|
||||
{
|
||||
options.transform.localScale = new Vector3(0,0,0);
|
||||
characterCreation.transform.localScale = new Vector3(1,1,1);
|
||||
options.transform.localScale = new Vector3(0, 0, 0);
|
||||
characterCreation.transform.localScale = new Vector3(1, 1, 1);
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("inName"));
|
||||
}
|
||||
|
||||
public void closeCharacterCreation()
|
||||
{
|
||||
options.transform.localScale = new Vector3(0,0,0);
|
||||
characterCreation.transform.localScale = new Vector3(0,0,0);
|
||||
options.transform.localScale = new Vector3(0, 0, 0);
|
||||
characterCreation.transform.localScale = new Vector3(0, 0, 0);
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnStart"));
|
||||
}
|
||||
|
||||
public void openOptions()
|
||||
{
|
||||
options.transform.localScale = new Vector3(1,1,1);
|
||||
characterCreation.transform.localScale = new Vector3(0,0,0);
|
||||
options.transform.localScale = new Vector3(1, 1, 1);
|
||||
characterCreation.transform.localScale = new Vector3(0, 0, 0);
|
||||
FileHandler.loadOptionDisplay();
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnAudio"));
|
||||
showOptionView("audio");
|
||||
@@ -107,12 +106,13 @@ namespace Assets.Scripts.Menu
|
||||
|
||||
public void closeOptions()
|
||||
{
|
||||
options.transform.localScale = new Vector3(0,0,0);
|
||||
characterCreation.transform.localScale = new Vector3(0,0,0);
|
||||
options.transform.localScale = new Vector3(0, 0, 0);
|
||||
characterCreation.transform.localScale = new Vector3(0, 0, 0);
|
||||
EventSystem.current.SetSelectedGameObject(GameObject.Find("btnStart"));
|
||||
}
|
||||
|
||||
public string saveVideoSettings(){
|
||||
public string saveVideoSettings()
|
||||
{
|
||||
GameObject resolution = GameObject.Find("dropResolution");
|
||||
GameObject mode = GameObject.Find("dropMode");
|
||||
string result = "";
|
||||
@@ -150,12 +150,13 @@ namespace Assets.Scripts.Menu
|
||||
}
|
||||
break;
|
||||
}
|
||||
result = result + "Resolution:"+resolution.GetComponent<Dropdown>().value+"\r\n";
|
||||
result = result + "Mode:"+mode.GetComponent<Dropdown>().value;
|
||||
result = result + "Resolution:" + resolution.GetComponent<Dropdown>().value + "\r\n";
|
||||
result = result + "Mode:" + mode.GetComponent<Dropdown>().value;
|
||||
return result;
|
||||
}
|
||||
|
||||
public string saveLanguage(){
|
||||
public string saveLanguage()
|
||||
{
|
||||
GameObject language = GameObject.Find("dropLanguage");
|
||||
string result = "";
|
||||
switch (language.GetComponent<Dropdown>().value)
|
||||
@@ -167,7 +168,17 @@ namespace Assets.Scripts.Menu
|
||||
result = "en";
|
||||
break;
|
||||
}
|
||||
result = "Language:"+result;
|
||||
result = "Language:" + result;
|
||||
return result;
|
||||
}
|
||||
|
||||
public string saveAudioSettings()
|
||||
{
|
||||
string result = "";
|
||||
float music = GameObject.Find("slideMusic").GetComponent<Slider>().value;
|
||||
float effects = GameObject.Find("slideEffects").GetComponent<Slider>().value;
|
||||
result = result + "Music:" + music + "\r\n";
|
||||
result = result + "Effects:" + effects;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -192,23 +203,29 @@ namespace Assets.Scripts.Menu
|
||||
sceneHandler.openGameScene();
|
||||
}
|
||||
|
||||
public bool isCharacterCreation(){
|
||||
public bool isCharacterCreation()
|
||||
{
|
||||
return characterCreation.activeSelf;
|
||||
}
|
||||
|
||||
public void showOptionView(string key){
|
||||
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);
|
||||
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);
|
||||
else
|
||||
{
|
||||
optionContent.transform.GetChild(i).transform.localScale = new Vector3(0, 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void switchLanguage(){
|
||||
public void switchLanguage()
|
||||
{
|
||||
GameObject language = GameObject.Find("dropLanguage");
|
||||
switch (language.GetComponent<Dropdown>().value)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user