integration

bad other team code on another branch
This commit is contained in:
Crizomb 2025-01-28 23:58:50 +01:00
parent 7925fd966a
commit 521a62973a
278 changed files with 11344 additions and 0 deletions

View 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()
{
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: eb6be98e8ad485528a6f0241b6e6df90

View 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();
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: d54fff469da868b898b10d9a2dadc850

View 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;
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 0698fd8378f2603d08fa38f7074a2ff3

View 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());
}
}

View file

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 307a1f6e5ebe37b4f89085a762648529