mirror of
https://github.com/ConjureETS/MTI860_VR_Multi_Controller.git
synced 2026-03-25 13:01:15 +00:00
Adding Position
This commit is contained in:
parent
fbb8e46f22
commit
43f48e9d5c
@ -38,7 +38,7 @@ RenderSettings:
|
|||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 705507994}
|
m_Sun: {fileID: 705507994}
|
||||||
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
|
m_IndirectSpecularColor: {r: 0.18028334, g: 0.2257134, b: 0.30692226, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
@ -10572,6 +10572,11 @@ PrefabInstance:
|
|||||||
m_Modification:
|
m_Modification:
|
||||||
m_TransformParent: {fileID: 0}
|
m_TransformParent: {fileID: 0}
|
||||||
m_Modifications:
|
m_Modifications:
|
||||||
|
- target: {fileID: 2077104797511503972, guid: cdbac44d9cb15a04684f19dd29e2f2db,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: nomDuJoueur
|
||||||
|
value:
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 3224832257380790144, guid: cdbac44d9cb15a04684f19dd29e2f2db,
|
- target: {fileID: 3224832257380790144, guid: cdbac44d9cb15a04684f19dd29e2f2db,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_LocalPosition.x
|
propertyPath: m_LocalPosition.x
|
||||||
|
|||||||
@ -37,13 +37,15 @@ public class Executable : MonoBehaviour
|
|||||||
{
|
{
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!noMovementChange)
|
if (!noMovementChange)
|
||||||
{
|
{
|
||||||
PlayerPrefs.SetInt(Constant.PPK_MOVEMENT_CHOICE, (int)nextMouv);
|
PlayerPrefs.SetInt(Constant.PPK_MOVEMENT_CHOICE, (int)nextMouv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsQuickTeleport)
|
if (IsQuickTeleport)
|
||||||
{
|
{
|
||||||
SceneManager.LoadScene(NextScene);
|
LoadScene();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -70,14 +72,20 @@ public class Executable : MonoBehaviour
|
|||||||
|
|
||||||
yield return new WaitForSeconds(1.5f);
|
yield return new WaitForSeconds(1.5f);
|
||||||
DataSaver.SaveTime();
|
DataSaver.SaveTime();
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
{
|
{
|
||||||
SceneManager.LoadScene(NextScene);
|
LoadScene();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LoadScene()
|
||||||
|
{
|
||||||
|
PlayerPrefs.SetString(Constant.PPK_SCENE_NAME, NextScene);
|
||||||
|
SceneManager.LoadScene(NextScene);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTriggerEnter(Collider other)
|
private void OnTriggerEnter(Collider other)
|
||||||
{
|
{
|
||||||
Debug.Log("Demon detected the colision");
|
Debug.Log("Demon detected the colision");
|
||||||
|
|||||||
8
Assets/Scripts/Utilities.meta
Normal file
8
Assets/Scripts/Utilities.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 4f1d4bc46e609714da5be82a80838718
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -9,6 +9,7 @@ namespace Assets.Scripts
|
|||||||
class Constant
|
class Constant
|
||||||
{
|
{
|
||||||
// Files
|
// Files
|
||||||
|
public const string FILE_PATH = ""; // DO NOT PUSH THIS, OR I KILL YOU... TWICE
|
||||||
public const string FILE_TIME = "TimeFile.txt";
|
public const string FILE_TIME = "TimeFile.txt";
|
||||||
|
|
||||||
// Game Tag
|
// Game Tag
|
||||||
@ -19,5 +20,6 @@ namespace Assets.Scripts
|
|||||||
public const string PPK_PLAYER_NAME = "PlayerName";
|
public const string PPK_PLAYER_NAME = "PlayerName";
|
||||||
public const string PPK_TIMER_TIME = "Time";
|
public const string PPK_TIMER_TIME = "Time";
|
||||||
public const string PPK_MOVEMENT_CHOICE = "mouvement";
|
public const string PPK_MOVEMENT_CHOICE = "mouvement";
|
||||||
|
public const string PPK_SCENE_NAME = "scene";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
Assets/Scripts/Utilities/Constant.cs.meta
Normal file
11
Assets/Scripts/Utilities/Constant.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 22e6602b147a64c4994b68f0cf5c45f6
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -12,22 +12,31 @@ namespace Assets.Scripts.Utilities
|
|||||||
{
|
{
|
||||||
public static void SaveTime()
|
public static void SaveTime()
|
||||||
{
|
{
|
||||||
//Nom du mouvement - Nom du joueur - Stage - Temps d'exécution
|
|
||||||
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 time = PlayerPrefs.GetString(Constant.PPK_TIMER_TIME);
|
string time = PlayerPrefs.GetString(Constant.PPK_TIMER_TIME);
|
||||||
string stage = ""; // TODO
|
string stage = PlayerPrefs.GetString(Constant.PPK_SCENE_NAME);
|
||||||
string toSave = movementName + " - " + playerName + " - " + stage + " - "+ time;
|
string toSave = movementName + " - " + playerName + " - " + stage + " - "+ time;
|
||||||
writeToFile(toSave);
|
writeToFile(toSave);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SavePosition()
|
||||||
|
{
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
|
||||||
private static async void writeToFile(string toSave)
|
private static async void writeToFile(string toSave)
|
||||||
{
|
{
|
||||||
using StreamWriter file = new(Constant.FILE_TIME);
|
using StreamWriter file = new(Constant.FILE_PATH + Constant.FILE_TIME);
|
||||||
|
|
||||||
await file.WriteLineAsync(toSave);
|
await file.WriteLineAsync(toSave);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO writeToFile(toSave, fileName) pour les positions
|
private static async void writeToFile(List<float, float> toSave, string fileName)
|
||||||
|
{
|
||||||
|
using StreamWriter file = new(Constant.FILE_PATH + fileName);
|
||||||
|
|
||||||
|
await file.WriteLineAsync(toSave);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
Assets/Scripts/Utilities/DataSaver.cs.meta
Normal file
11
Assets/Scripts/Utilities/DataSaver.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a130981115fac9f4bbf97cd9559e28f9
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
14
Assets/Scripts/Utilities/Position.cs
Normal file
14
Assets/Scripts/Utilities/Position.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Assets.Scripts.Utilities
|
||||||
|
{
|
||||||
|
class Position
|
||||||
|
{
|
||||||
|
private float x;
|
||||||
|
private float y;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user