mirror of
https://github.com/ConjureETS/MTI860_VR_Multi_Controller.git
synced 2026-03-25 21:11:14 +00:00
Refactor
This commit is contained in:
parent
f23ed304ba
commit
04d85e080b
@ -1,12 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Utilities;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using static MovementGen;
|
||||
using UnityEngine.SceneManagement;
|
||||
using static Assets.Scripts.MovementGen;
|
||||
|
||||
namespace Assets.Scripts.HammerScript
|
||||
{
|
||||
public class Executable : MonoBehaviour
|
||||
{
|
||||
public Timer timer;
|
||||
@ -56,7 +55,7 @@ public class Executable : MonoBehaviour
|
||||
}
|
||||
|
||||
private int count = 0;
|
||||
IEnumerator TimerExecute()
|
||||
private IEnumerator TimerExecute()
|
||||
{
|
||||
count = 6;
|
||||
while (true)
|
||||
@ -91,3 +90,4 @@ public class Executable : MonoBehaviour
|
||||
Debug.Log("Demon detected the colision");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts.HammerScript
|
||||
{
|
||||
public class HammerTrigger : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
@ -27,3 +27,4 @@ public class HammerTrigger : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Movements;
|
||||
using Assets.Scripts.Utilities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts
|
||||
{
|
||||
public class MovementGen : MonoBehaviour
|
||||
{
|
||||
private Dictionary<ChoiceOfMovement, MonoBehaviour> components;
|
||||
@ -65,3 +66,4 @@ public class MovementGen : MonoBehaviour
|
||||
omni = 4
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Random = System.Random;
|
||||
|
||||
namespace Assets.Scripts
|
||||
{
|
||||
public class RandomDemonSpawn : MonoBehaviour
|
||||
{
|
||||
public GameObject[] listeCommeTuVeux;
|
||||
@ -24,3 +23,4 @@ public class RandomDemonSpawn : MonoBehaviour
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,12 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Assets.Scripts
|
||||
namespace Assets.Scripts.Utilities
|
||||
{
|
||||
class Constant
|
||||
public class Constant
|
||||
{
|
||||
public const string SEPARATOR = "-";
|
||||
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts.Utilities
|
||||
{
|
||||
class DataSaver
|
||||
public class DataSaver
|
||||
{
|
||||
public static void SaveTime()
|
||||
{
|
||||
@ -17,7 +13,7 @@ namespace Assets.Scripts.Utilities
|
||||
string time = PlayerPrefs.GetString(Constant.PPK_TIMER_TIME);
|
||||
string stage = PlayerPrefs.GetString(Constant.PPK_SCENE_NAME);
|
||||
string toSave = movementName + Constant.SEPARATOR + playerName + Constant.SEPARATOR + stage + Constant.SEPARATOR + time;
|
||||
writeToFile(toSave);
|
||||
WriteToFile(toSave);
|
||||
}
|
||||
|
||||
public static void SavePosition(List<Position> positions)
|
||||
@ -25,17 +21,17 @@ namespace Assets.Scripts.Utilities
|
||||
string playerName = PlayerPrefs.GetString(Constant.PPK_PLAYER_NAME);
|
||||
string movementName = ((MovementGen.ChoiceOfMovement)PlayerPrefs.GetInt(Constant.PPK_MOVEMENT_CHOICE)).ToString();
|
||||
string stage = PlayerPrefs.GetString(Constant.PPK_SCENE_NAME);
|
||||
string fileName = movementName + Constant.SEPARATOR + playerName + Constant.SEPARATOR + stage;
|
||||
writeToFile(positions, fileName);
|
||||
string fileName = "position" + Constant.SEPARATOR + movementName + Constant.SEPARATOR + playerName + Constant.SEPARATOR + stage;
|
||||
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);
|
||||
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);
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
namespace Assets.Scripts.Utilities
|
||||
{
|
||||
class Position
|
||||
public class Position
|
||||
{
|
||||
private float x { get; set; }
|
||||
private float y { get; set; }
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
using Assets.Scripts.Utilities;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scripts.Utilities
|
||||
{
|
||||
public class PositionManager : MonoBehaviour
|
||||
{
|
||||
public GameObject player;
|
||||
@ -38,3 +39,4 @@ public class PositionManager : MonoBehaviour
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Assets.Scripts;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scripts.Utilities
|
||||
{
|
||||
public class Timer : MonoBehaviour
|
||||
{
|
||||
private float time { get; set; }
|
||||
@ -51,3 +50,4 @@ public class Timer : MonoBehaviour
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user