68 lines
1.6 KiB
C#
68 lines
1.6 KiB
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
using UnityEngine.UI;
|
||
|
using UnityEngine.SceneManagement;
|
||
|
|
||
|
public class SettingsMenu : MonoBehaviour
|
||
|
{
|
||
|
public static Settings settings;
|
||
|
public Text description;
|
||
|
// Start is called before the first frame update
|
||
|
void Start()
|
||
|
{
|
||
|
settings = new Settings();
|
||
|
}
|
||
|
public void doExitGame()
|
||
|
{
|
||
|
Application.Quit();
|
||
|
}
|
||
|
public void setX(float a)
|
||
|
{
|
||
|
settings.sizeX = (int)a;
|
||
|
}
|
||
|
public void setY(float a)
|
||
|
{
|
||
|
settings.sizeY = (int)a;
|
||
|
}
|
||
|
public void setAnts(float a)
|
||
|
{
|
||
|
settings.antsCount = (int)a;
|
||
|
}
|
||
|
public void setFps(float a)
|
||
|
{
|
||
|
settings.fps = (int)a;
|
||
|
}
|
||
|
public void setRefreshFood(float a)
|
||
|
{
|
||
|
settings.refreshFood = (int)a;
|
||
|
}
|
||
|
public void setWeakenPheromones(float a)
|
||
|
{
|
||
|
settings.weakenPheromones = (int)a;
|
||
|
}
|
||
|
public void start()
|
||
|
{
|
||
|
SceneManager.LoadScene (sceneName:"theAntsAreMarching");
|
||
|
}
|
||
|
|
||
|
// Update is called once per frame
|
||
|
void Update()
|
||
|
{
|
||
|
if(description!=null)
|
||
|
{
|
||
|
var textall = "";
|
||
|
textall += "sizeX = " + settings.sizeX + "\n\n";
|
||
|
textall += "sizeY = " + settings.sizeY + "\n\n";
|
||
|
textall += "antsCount"+" = " + settings.antsCount + "\n\n";
|
||
|
textall += "fps"+" = " + settings.fps + "\n\n";
|
||
|
textall += "refreshFood"+" = " + settings.refreshFood + "\n\n";
|
||
|
textall += "weakenPheromones"+" = " + settings.weakenPheromones + "\n\n";
|
||
|
|
||
|
description.text = textall;
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|