Merge remote-tracking branch 'origin/PauseMenu' into staging2

# Conflicts:
#	ProjectSettings/EditorBuildSettings.asset
#	ProjectSettings/TagManager.asset
This commit is contained in:
HelarJ 2022-04-11 19:10:18 +03:00
commit fd4432fc6d
36 changed files with 40092 additions and 86 deletions

View File

@ -474,7 +474,7 @@ GameObject:
- component: {fileID: 13646088}
m_Layer: 0
m_Name: hands_coll:b_r_index3
m_TagString: Untagged
m_TagString: Hand
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@ -502,8 +502,8 @@ CapsuleCollider:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 157110}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 0
m_IsTrigger: 1
m_Enabled: 1
m_Radius: 0.01
m_Height: 0.05
m_Direction: 2

View File

@ -8,6 +8,7 @@ public class ArmSwingLocomotion : MonoBehaviour
public GameObject RightHand;
public GameObject CenterEyeCamera;
public GameObject ForwardDirection;
public GameObject Player;
private Vector3 PositionPreviousFrameLeftHand;
private Vector3 PositionPreviousFrameRightHand;
@ -22,7 +23,7 @@ public class ArmSwingLocomotion : MonoBehaviour
// Start is called before the first frame update
void Start()
{
PlayerPositionPreviousFrame = transform.position;
PlayerPositionPreviousFrame = Player.transform.position;
PositionPreviousFrameLeftHand = LeftHand.transform.position;
PlayerPositionPreviousFrame = RightHand.transform.position;
}
@ -33,13 +34,13 @@ public class ArmSwingLocomotion : MonoBehaviour
float Yrot = CenterEyeCamera.transform.eulerAngles.y;
ForwardDirection.transform.eulerAngles = new Vector3(0, Yrot, 0);
/*float Yrot = CenterEyeCamera.transform.eulerAngles.y;
ForwardDirection.transform.eulerAngles = new Vector3(0, Yrot, 0);*/
PositionCurrentFrameLeftHand = LeftHand.transform.position;
PositionCurrentFrameRightHand = RightHand.transform.position;
PlayerPositionCurrentFrame = transform.position;
PlayerPositionCurrentFrame = Player.transform.position;
//Debug.Log("Previous" + PositionPreviousFrameLeftHand);
//Debug.Log("Current" + PositionCurrentFrameLeftHand);
@ -52,7 +53,7 @@ public class ArmSwingLocomotion : MonoBehaviour
if (Time.timeSinceLevelLoad > 1f)
{
transform.position += ForwardDirection.transform.forward * HandSpeed * Speed * Time.deltaTime;
Player.transform.position += ForwardDirection.transform.forward * HandSpeed * Speed * Time.deltaTime;
}
PositionPreviousFrameLeftHand = PositionCurrentFrameLeftHand;

View File

@ -0,0 +1,38 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChangeButtonColor : MonoBehaviour
{
[SerializeField] private Color enterColor = Color.white;
[SerializeField] private Color exitColor = Color.white;
private MeshCollider _collider;
private MeshRenderer _renderer;
// Start is called before the first frame update
void Start()
{
_collider = GetComponent<MeshCollider>();
_renderer = GetComponent<MeshRenderer>();
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Hand")
{
_renderer.material.color = enterColor;
Debug.Log("Touched!");
}
}
private void OnTriggerExit(Collider other)
{
if (other.tag == "Hand")
{
_renderer.material.color = exitColor;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a16108a6f7081d14f9f5a046ac04b8c2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,33 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ChangeButtonColorLocomotion : MonoBehaviour
{
[SerializeField] private Color enterColor = Color.white;
[SerializeField] private Color exitColor = Color.white;
private MeshCollider _collider;
private MeshRenderer _renderer;
// Start is called before the first frame update
void Start()
{
_collider = GetComponent<MeshCollider>();
_renderer = GetComponent<MeshRenderer>();
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Hand")
{
if(_renderer.material.color != enterColor)
_renderer.material.color = enterColor;
else
_renderer.material.color = exitColor;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ae634ea4fe8cb874487372a3d7c595bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ControllLocomotion : MonoBehaviour
{
public GameObject XRorigin;
public GameObject ArmSwingButton;
public GameObject JoyStickButton;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ca1db91ee57976944aa22ed347811963
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnableArmSwing : MonoBehaviour
{
private MeshCollider _collider;
private MeshRenderer _renderer;
public GameObject Player;
// Start is called before the first frame update
void Start()
{
_collider = GetComponent<MeshCollider>();
_renderer = GetComponent<MeshRenderer>();
Player.GetComponent<ArmSwingLocomotion>().enabled = false;
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Hand")
{
if(Player.GetComponent<ArmSwingLocomotion>().enabled == true)
Player.GetComponent<ArmSwingLocomotion>().enabled = false;
else
Player.GetComponent<ArmSwingLocomotion>().enabled = true;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 696a55bfea145fa4b9029ff2d359c16d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnableDash : MonoBehaviour
{
private MeshCollider _collider;
private MeshRenderer _renderer;
public GameObject Player;
// Start is called before the first frame update
void Start()
{
_collider = GetComponent<MeshCollider>();
_renderer = GetComponent<MeshRenderer>();
Player.GetComponent<Dash>().enabled = false;
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Hand")
{
if (Player.GetComponent<Dash>().enabled == true)
Player.GetComponent<Dash>().enabled = false;
else
Player.GetComponent<Dash>().enabled = true;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 84e3386cbd3fd2c418ecf357af19ba5f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,28 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnableJoyStick : MonoBehaviour
{
private MeshCollider _collider;
private MeshRenderer _renderer;
public GameObject LocomotionSystem;
// Start is called before the first frame update
void Start()
{
_collider = GetComponent<MeshCollider>();
_renderer = GetComponent<MeshRenderer>();
LocomotionSystem.SetActive(false);
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Hand")
{
LocomotionSystem.SetActive(!LocomotionSystem.activeSelf);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a63e1d5bde5a60c45aa409546e55b920
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,16 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class EnterGameScene : MonoBehaviour
{
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Player")
{
SceneManager.LoadScene("GameScene");
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f1114a137d02f184db2b6291d9d31cb5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,20 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ForwardDirection : MonoBehaviour
{
public GameObject CenterEyeCamera;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
float Yrot = CenterEyeCamera.transform.eulerAngles.y;
transform.eulerAngles = new Vector3(0, Yrot, 0);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 01869e86b22555a449cd53043f5c4afa
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class LocomotionSettingButton : MonoBehaviour
{
private MeshCollider _collider;
public GameObject LocomotionPanel;
// Start is called before the first frame update
void Start()
{
_collider = GetComponent<MeshCollider>();
LocomotionPanel.SetActive(false);
}
private void OnTriggerEnter(Collider other)
{
if (other.tag == "Hand")
{
LocomotionPanel.SetActive(!LocomotionPanel.activeSelf);
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8ac280753a1d95a43a1fbcfd69708d7a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PauseMenu : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 5a2662b3abecb914cad356619e832f13
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
/*public int level;
public int health;*/
public void SavePlayer()
{
SaveSystem.SavePlayer(this);
}
public void LoadPlayer()
{
PlayerData data = SaveSystem.LoadPlayer();
Vector3 position;
position.x = data.position[0];
position.y = data.position[1];
position.z = data.position[2];
transform.position = position;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6ff82a98832d12249b30083bc9ae2dd3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[System.Serializable]
public class PlayerData
{
/*public int level;
public int health;*/
public float[] position;
public PlayerData(Player player)
{
/*level = player.level;
health = player.health;*/
position = new float[3];
position[0] = player.transform.position.x;
position[1] = player.transform.position.y;
position[2] = player.transform.position.z;
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 9cdb4de85d282744083c6d9cee4fef3c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
public static class SaveSystem
{
public static void SavePlayer(Player player)
{
BinaryFormatter formatter = new BinaryFormatter();
string path = Application.persistentDataPath + "/player.data";
FileStream stream = new FileStream(path, FileMode.Create);
PlayerData data = new PlayerData(player);
formatter.Serialize(stream, data);
stream.Close();
}
public static PlayerData LoadPlayer ()
{
string path = Application.persistentDataPath + "/player.data";
if (File.Exists(path))
{
BinaryFormatter formatter = new BinaryFormatter();
FileStream stream = new FileStream(path, FileMode.Open);
PlayerData data = formatter.Deserialize(stream) as PlayerData;
stream.Close();
return data;
}
else
{
Debug.Log("Save File not found in " + path);
return null;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 49c2ebd233ef7a547b12ce163244e30a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -6,8 +6,8 @@ public class TriggerDoorController : MonoBehaviour
{
[SerializeField] private Animator myDoor = null;
[SerializeField] private bool openTrigger = false;
[SerializeField] private bool closeTrigger = false;
[SerializeField] private bool Trigger = false;
//[SerializeField] private bool closeTrigger = false;
[SerializeField] private string doorOpen = "DoorOpen";
[SerializeField] private string doorClose = "DoorClose";
@ -19,17 +19,26 @@ public class TriggerDoorController : MonoBehaviour
if (other.CompareTag("Player"))
{
Debug.Log("col");
if (openTrigger)
if (Trigger)
{
Debug.Log("open");
myDoor.Play(doorOpen, 0, 0.0f);
gameObject.SetActive(false);
}
else if (closeTrigger)
/*else if (closeTrigger)
{
myDoor.Play(doorClose, 0, 0.0f);
}*/
}
}
public void OnTriggerExit(Collider other)
{
if (other.CompareTag("Player"))
{
if (Trigger)
{
myDoor.Play(doorClose, 0, 0.0f);
gameObject.SetActive(false);
}
}
}

View File

@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
public class XRGUI : MonoBehaviour
{
[SerializeField]
private Button SettingsButton;
[SerializeField]
private Button LoadButton;
[SerializeField]
private Button ExitButton;
// Start is called before the first frame update
void Start()
{
SettingsButton.onClick.AddListener(() =>
{
});
LoadButton.onClick.AddListener(() =>
{
});
ExitButton.onClick.AddListener(() =>
{
Debug.Log("Clicked");
UnityEditor.EditorApplication.isPlaying = false;
});
}
// Update is called once per frame
void Update()
{
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 37cfb6899ccd00b4280ac4eb92f84851
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8fd0e18070efeda42bb8ab22afe4a9fb
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e45278868e3d39f45929cb5142b6c572
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff