Added Restart Voting

This commit is contained in:
firefighter198
2021-10-05 22:21:16 +02:00
parent 92564bf817
commit f7c17cba0d
8 changed files with 1594 additions and 28 deletions
+48
View File
@@ -0,0 +1,48 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
public class Buttons : MonoBehaviour
{
public Button buttonRestart1, buttonRestart2;
private bool restart1 = false, restart2 = false;
public void ButtonRestart1()
{
restart1 = !restart1;
if (restart1)
{
buttonRestart1.GetComponent<Image>().color = new Color(.1f, .5f, .1f, .2f);
}
else
{
buttonRestart1.GetComponent<Image>().color = new Color(.1f, .1f, .1f, .2f);
}
RestartRequest();
}
public void ButtonRestart2()
{
restart2 = !restart2;
if (restart2)
{
buttonRestart2.GetComponent<Image>().color = new Color(.1f, .5f, .1f, .2f);
}
else
{
buttonRestart2.GetComponent<Image>().color = new Color(.1f, .1f, .1f, .2f);
}
RestartRequest();
}
private void RestartRequest()
{
if (restart1 && restart2)
{
SceneManager.LoadScene(0, LoadSceneMode.Single);
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 65b66293cc480be4e8c0ff3534cf4834
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: