This commit is contained in:
Davcris911 2021-11-16 09:55:09 -05:00
parent f23ed304ba
commit 04d85e080b
9 changed files with 248 additions and 253 deletions

View File

@ -1,14 +1,13 @@
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Assets.Scripts;
using Assets.Scripts.Utilities; using Assets.Scripts.Utilities;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
using static MovementGen;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using static Assets.Scripts.MovementGen;
public class Executable : MonoBehaviour namespace Assets.Scripts.HammerScript
{ {
public class Executable : MonoBehaviour
{
public Timer timer; public Timer timer;
public string NextScene; public string NextScene;
public TextMesh text; public TextMesh text;
@ -56,7 +55,7 @@ public class Executable : MonoBehaviour
} }
private int count = 0; private int count = 0;
IEnumerator TimerExecute() private IEnumerator TimerExecute()
{ {
count = 6; count = 6;
while (true) while (true)
@ -90,4 +89,5 @@ public class Executable : MonoBehaviour
{ {
Debug.Log("Demon detected the colision"); Debug.Log("Demon detected the colision");
} }
}
} }

View File

@ -1,10 +1,10 @@
using System.Collections; using Assets.Scripts.Utilities;
using System.Collections.Generic;
using Assets.Scripts;
using UnityEngine; using UnityEngine;
public class HammerTrigger : MonoBehaviour namespace Assets.Scripts.HammerScript
{ {
public class HammerTrigger : MonoBehaviour
{
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {
@ -26,4 +26,5 @@ public class HammerTrigger : MonoBehaviour
ex.Execute(); ex.Execute();
} }
} }
}
} }

View File

@ -1,12 +1,13 @@
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Assets.Scripts;
using Assets.Scripts.Movements; using Assets.Scripts.Movements;
using Assets.Scripts.Utilities;
using UnityEngine; using UnityEngine;
public class MovementGen : MonoBehaviour namespace Assets.Scripts
{ {
public class MovementGen : MonoBehaviour
{
private Dictionary<ChoiceOfMovement, MonoBehaviour> components; private Dictionary<ChoiceOfMovement, MonoBehaviour> components;
private ChoiceOfMovement currentMovement; private ChoiceOfMovement currentMovement;
@ -64,4 +65,5 @@ public class MovementGen : MonoBehaviour
joycon = 3, joycon = 3,
omni = 4 omni = 4
} }
}
} }

View File

@ -1,11 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using Random = System.Random; using Random = System.Random;
public class RandomDemonSpawn : MonoBehaviour namespace Assets.Scripts
{ {
public class RandomDemonSpawn : MonoBehaviour
{
public GameObject[] listeCommeTuVeux; public GameObject[] listeCommeTuVeux;
// Start is called before the first frame update // Start is called before the first frame update
@ -23,4 +22,5 @@ public class RandomDemonSpawn : MonoBehaviour
{ {
} }
}
} }

View File

@ -1,12 +1,6 @@
using System; namespace Assets.Scripts.Utilities
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assets.Scripts
{ {
class Constant public class Constant
{ {
public const string SEPARATOR = "-"; public const string SEPARATOR = "-";

View File

@ -1,14 +1,10 @@
using System; using System.Collections.Generic;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine; using UnityEngine;
namespace Assets.Scripts.Utilities namespace Assets.Scripts.Utilities
{ {
class DataSaver public class DataSaver
{ {
public static void SaveTime() public static void SaveTime()
{ {
@ -17,7 +13,7 @@ namespace Assets.Scripts.Utilities
string time = PlayerPrefs.GetString(Constant.PPK_TIMER_TIME); string time = PlayerPrefs.GetString(Constant.PPK_TIMER_TIME);
string stage = PlayerPrefs.GetString(Constant.PPK_SCENE_NAME); string stage = PlayerPrefs.GetString(Constant.PPK_SCENE_NAME);
string toSave = movementName + Constant.SEPARATOR + playerName + Constant.SEPARATOR + stage + Constant.SEPARATOR + time; string toSave = movementName + Constant.SEPARATOR + playerName + Constant.SEPARATOR + stage + Constant.SEPARATOR + time;
writeToFile(toSave); WriteToFile(toSave);
} }
public static void SavePosition(List<Position> positions) public static void SavePosition(List<Position> positions)
@ -25,17 +21,17 @@ namespace Assets.Scripts.Utilities
string playerName = PlayerPrefs.GetString(Constant.PPK_PLAYER_NAME); string playerName = PlayerPrefs.GetString(Constant.PPK_PLAYER_NAME);
string movementName = ((MovementGen.ChoiceOfMovement)PlayerPrefs.GetInt(Constant.PPK_MOVEMENT_CHOICE)).ToString(); string movementName = ((MovementGen.ChoiceOfMovement)PlayerPrefs.GetInt(Constant.PPK_MOVEMENT_CHOICE)).ToString();
string stage = PlayerPrefs.GetString(Constant.PPK_SCENE_NAME); string stage = PlayerPrefs.GetString(Constant.PPK_SCENE_NAME);
string fileName = movementName + Constant.SEPARATOR + playerName + Constant.SEPARATOR + stage; string fileName = "position" + Constant.SEPARATOR + movementName + Constant.SEPARATOR + playerName + Constant.SEPARATOR + stage;
writeToFile(positions, fileName); WriteToFile(positions, fileName);
} }
private static async void writeToFile(string toSave) private static async void WriteToFile(string toSave)
{ {
using StreamWriter file = File.AppendText(Constant.FILE_PATH + Constant.FILE_TIME + Constant.FILE_EXTENSION); using StreamWriter file = File.AppendText(Constant.FILE_PATH + Constant.FILE_TIME + Constant.FILE_EXTENSION);
await file.WriteLineAsync(toSave); await file.WriteLineAsync(toSave);
} }
private static async void writeToFile(List<Position> positions, string fileName) private static async void WriteToFile(List<Position> positions, string fileName)
{ {
using StreamWriter file = File.AppendText(Constant.FILE_PATH + fileName + Constant.FILE_EXTENSION); using StreamWriter file = File.AppendText(Constant.FILE_PATH + fileName + Constant.FILE_EXTENSION);

View File

@ -1,6 +1,6 @@
namespace Assets.Scripts.Utilities namespace Assets.Scripts.Utilities
{ {
class Position public class Position
{ {
private float x { get; set; } private float x { get; set; }
private float y { get; set; } private float y { get; set; }

View File

@ -1,10 +1,11 @@
using Assets.Scripts.Utilities;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
public class PositionManager : MonoBehaviour namespace Assets.Scripts.Utilities
{ {
public class PositionManager : MonoBehaviour
{
public GameObject player; public GameObject player;
private List<Position> data; private List<Position> data;
public bool notSended = true; public bool notSended = true;
@ -37,4 +38,5 @@ public class PositionManager : MonoBehaviour
DataSaver.SavePosition(data); DataSaver.SavePosition(data);
} }
}
} }

View File

@ -1,11 +1,10 @@
using System.Collections; using System.Collections;
using System.Collections.Generic;
using Assets.Scripts;
using UnityEngine; using UnityEngine;
using UnityEngine.UI;
public class Timer : MonoBehaviour namespace Assets.Scripts.Utilities
{ {
public class Timer : MonoBehaviour
{
private float time { get; set; } private float time { get; set; }
private bool timerStop { get; set; } private bool timerStop { get; set; }
@ -50,4 +49,5 @@ public class Timer : MonoBehaviour
} }
} }
}
} }