Import
temp
This commit is contained in:
parent
a87f0ed109
commit
a17810ffeb
114 changed files with 5184 additions and 5 deletions
16
Assets/otherTeam/OtherScripts/UI Scripts/Coin Manager.cs
Executable file
16
Assets/otherTeam/OtherScripts/UI Scripts/Coin Manager.cs
Executable file
|
@ -0,0 +1,16 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class CoinManager : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
2
Assets/otherTeam/OtherScripts/UI Scripts/Coin Manager.cs.meta
Executable file
2
Assets/otherTeam/OtherScripts/UI Scripts/Coin Manager.cs.meta
Executable file
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: eb6be98e8ad485528a6f0241b6e6df90
|
38
Assets/otherTeam/OtherScripts/UI Scripts/EnemiesAliveManager.cs
Executable file
38
Assets/otherTeam/OtherScripts/UI Scripts/EnemiesAliveManager.cs
Executable file
|
@ -0,0 +1,38 @@
|
|||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class EnemiesAliveManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameManager gameManager;
|
||||
[SerializeField] GameObject enemiesAliveCanvas;
|
||||
[SerializeField] GameObject enemiesAliveDisplay;
|
||||
private TextMeshProUGUI enemiesAliveMesh;
|
||||
|
||||
private bool switchedCanvasOn = false;
|
||||
|
||||
private bool switchedCanvasOff = false;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
enemiesAliveMesh = enemiesAliveDisplay.GetComponent<TextMeshProUGUI>();
|
||||
enemiesAliveCanvas.SetActive(false);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (!switchedCanvasOn && gameManager.combatPhase)
|
||||
{
|
||||
enemiesAliveCanvas.SetActive(true);
|
||||
switchedCanvasOn = true;
|
||||
}
|
||||
|
||||
if (switchedCanvasOn && !switchedCanvasOff && !gameManager.combatPhase)
|
||||
{
|
||||
enemiesAliveCanvas.SetActive(false);
|
||||
switchedCanvasOff = true;
|
||||
}
|
||||
|
||||
enemiesAliveMesh.text = "Ennemies En Vie : " + gameManager.armyManager.getArmy(true).Count.ToString();
|
||||
}
|
||||
}
|
2
Assets/otherTeam/OtherScripts/UI Scripts/EnemiesAliveManager.cs.meta
Executable file
2
Assets/otherTeam/OtherScripts/UI Scripts/EnemiesAliveManager.cs.meta
Executable file
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d54fff469da868b898b10d9a2dadc850
|
51
Assets/otherTeam/OtherScripts/UI Scripts/Resolution Settings.cs
Executable file
51
Assets/otherTeam/OtherScripts/UI Scripts/Resolution Settings.cs
Executable file
|
@ -0,0 +1,51 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections.Generic;
|
||||
using TMPro;
|
||||
public class ResolutionSettings : MonoBehaviour
|
||||
{
|
||||
[SerializeField] public TMP_Dropdown resolutionDropdown;
|
||||
private Resolution[] resolutions =
|
||||
{
|
||||
new Resolution {width = 1280, height = 720},
|
||||
new Resolution {width = 1920, height = 1080},
|
||||
new Resolution {width = 2560, height = 1440},
|
||||
new Resolution {width = 3840, height = 2160}
|
||||
};
|
||||
private int selectedIndex = 0;
|
||||
[SerializeField] private Button applyButton;
|
||||
|
||||
|
||||
void Start()
|
||||
{
|
||||
resolutionDropdown.ClearOptions();
|
||||
List<string> options = new List<string>();
|
||||
|
||||
for (int i = 0; i < resolutions.Length; i++)
|
||||
{
|
||||
string option = resolutions[i].width + " x " + resolutions[i].height;
|
||||
options.Add(option);
|
||||
}
|
||||
|
||||
resolutionDropdown.AddOptions(options);
|
||||
|
||||
int savedResolutionIndex = PlayerPrefs.GetInt("ResolutionIndex", 0);
|
||||
resolutionDropdown.value = savedResolutionIndex;
|
||||
resolutionDropdown.RefreshShownValue();
|
||||
}
|
||||
|
||||
public void SetResolution()
|
||||
{
|
||||
Resolution resolution = resolutions[selectedIndex];
|
||||
Debug.Log(resolution.width + " x " + resolution.height);
|
||||
Screen.SetResolution(resolution.width, resolution.height, Screen.fullScreen);
|
||||
|
||||
PlayerPrefs.SetInt("ResolutionIndex", selectedIndex);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
|
||||
public void preSaveResolution()
|
||||
{
|
||||
selectedIndex = resolutionDropdown.value;
|
||||
}
|
||||
}
|
2
Assets/otherTeam/OtherScripts/UI Scripts/Resolution Settings.cs.meta
Executable file
2
Assets/otherTeam/OtherScripts/UI Scripts/Resolution Settings.cs.meta
Executable file
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 0698fd8378f2603d08fa38f7074a2ff3
|
56
Assets/otherTeam/OtherScripts/UI Scripts/Timer Manager.cs
Executable file
56
Assets/otherTeam/OtherScripts/UI Scripts/Timer Manager.cs
Executable file
|
@ -0,0 +1,56 @@
|
|||
using UnityEngine;
|
||||
using TMPro;
|
||||
|
||||
public class TimerManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] GameManager gameManager;
|
||||
[SerializeField] GameObject timerCanvas;
|
||||
[SerializeField] GameObject timer;
|
||||
private TextMeshProUGUI timerMesh;
|
||||
|
||||
[SerializeField] GameObject winTimer;
|
||||
private TextMeshProUGUI winTimerMesh;
|
||||
|
||||
[SerializeField] GameObject lostTimer;
|
||||
private TextMeshProUGUI lostTimerMesh;
|
||||
|
||||
|
||||
|
||||
private bool switchedCanvasOn = false;
|
||||
|
||||
private bool switchedCanvasOff = false;
|
||||
private float startTime;
|
||||
|
||||
private float endTime;
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
timerMesh = timer.GetComponent<TextMeshProUGUI>();
|
||||
winTimerMesh = winTimer.GetComponent<TextMeshProUGUI>();
|
||||
lostTimerMesh = lostTimer.GetComponent<TextMeshProUGUI>();
|
||||
timerCanvas.SetActive(false);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (!switchedCanvasOn && gameManager.combatPhase)
|
||||
{
|
||||
timerCanvas.SetActive(true);
|
||||
switchedCanvasOn = true;
|
||||
startTime = Time.time;
|
||||
}
|
||||
|
||||
if (switchedCanvasOn && !switchedCanvasOff && !gameManager.combatPhase)
|
||||
{
|
||||
timerCanvas.SetActive(false);
|
||||
switchedCanvasOff = true;
|
||||
endTime = Time.time-startTime;
|
||||
winTimerMesh.text = (((int)(endTime / 60)).ToString() + ":" + ((((int)(endTime) % 60) < 10) ? "0" : "") + ((int)(endTime) % 60).ToString());
|
||||
lostTimerMesh.text = (((int)(endTime / 60)).ToString() + ":" + ((((int)(endTime) % 60) < 10) ? "0" : "") + ((int)(endTime) % 60).ToString());
|
||||
}
|
||||
|
||||
float combatTime = Time.time - startTime;
|
||||
timerMesh.text = (((int)(combatTime / 60)).ToString() + ":" + ((((int)(combatTime) % 60) < 10) ? "0" : "") + ((int)(combatTime) % 60).ToString());
|
||||
}
|
||||
}
|
2
Assets/otherTeam/OtherScripts/UI Scripts/Timer Manager.cs.meta
Executable file
2
Assets/otherTeam/OtherScripts/UI Scripts/Timer Manager.cs.meta
Executable file
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 307a1f6e5ebe37b4f89085a762648529
|
Loading…
Add table
Add a link
Reference in a new issue