Compare commits
9 Commits
portals-an
...
PauseMenu
| Author | SHA1 | Date | |
|---|---|---|---|
| ba8883786b | |||
| 1ed57d5c31 | |||
| 26e2d0d1db | |||
| e0f3c3e580 | |||
| 194574ee65 | |||
| 53893b63a6 | |||
| aaf536d7ec | |||
| 808cbfd033 | |||
| 5d197d0958 |
@@ -474,7 +474,7 @@ GameObject:
|
|||||||
- component: {fileID: 13646088}
|
- component: {fileID: 13646088}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: hands_coll:b_r_index3
|
m_Name: hands_coll:b_r_index3
|
||||||
m_TagString: Untagged
|
m_TagString: Hand
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
@@ -502,8 +502,8 @@ CapsuleCollider:
|
|||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 157110}
|
m_GameObject: {fileID: 157110}
|
||||||
m_Material: {fileID: 0}
|
m_Material: {fileID: 0}
|
||||||
m_IsTrigger: 0
|
m_IsTrigger: 1
|
||||||
m_Enabled: 0
|
m_Enabled: 1
|
||||||
m_Radius: 0.01
|
m_Radius: 0.01
|
||||||
m_Height: 0.05
|
m_Height: 0.05
|
||||||
m_Direction: 2
|
m_Direction: 2
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ public class ArmSwingLocomotion : MonoBehaviour
|
|||||||
public GameObject RightHand;
|
public GameObject RightHand;
|
||||||
public GameObject CenterEyeCamera;
|
public GameObject CenterEyeCamera;
|
||||||
public GameObject ForwardDirection;
|
public GameObject ForwardDirection;
|
||||||
|
public GameObject Player;
|
||||||
|
|
||||||
private Vector3 PositionPreviousFrameLeftHand;
|
private Vector3 PositionPreviousFrameLeftHand;
|
||||||
private Vector3 PositionPreviousFrameRightHand;
|
private Vector3 PositionPreviousFrameRightHand;
|
||||||
@@ -22,7 +23,7 @@ public class ArmSwingLocomotion : MonoBehaviour
|
|||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
PlayerPositionPreviousFrame = transform.position;
|
PlayerPositionPreviousFrame = Player.transform.position;
|
||||||
PositionPreviousFrameLeftHand = LeftHand.transform.position;
|
PositionPreviousFrameLeftHand = LeftHand.transform.position;
|
||||||
PlayerPositionPreviousFrame = RightHand.transform.position;
|
PlayerPositionPreviousFrame = RightHand.transform.position;
|
||||||
}
|
}
|
||||||
@@ -33,13 +34,13 @@ public class ArmSwingLocomotion : MonoBehaviour
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
float Yrot = CenterEyeCamera.transform.eulerAngles.y;
|
/*float Yrot = CenterEyeCamera.transform.eulerAngles.y;
|
||||||
ForwardDirection.transform.eulerAngles = new Vector3(0, Yrot, 0);
|
ForwardDirection.transform.eulerAngles = new Vector3(0, Yrot, 0);*/
|
||||||
|
|
||||||
PositionCurrentFrameLeftHand = LeftHand.transform.position;
|
PositionCurrentFrameLeftHand = LeftHand.transform.position;
|
||||||
PositionCurrentFrameRightHand = RightHand.transform.position;
|
PositionCurrentFrameRightHand = RightHand.transform.position;
|
||||||
|
|
||||||
PlayerPositionCurrentFrame = transform.position;
|
PlayerPositionCurrentFrame = Player.transform.position;
|
||||||
|
|
||||||
//Debug.Log("Previous" + PositionPreviousFrameLeftHand);
|
//Debug.Log("Previous" + PositionPreviousFrameLeftHand);
|
||||||
//Debug.Log("Current" + PositionCurrentFrameLeftHand);
|
//Debug.Log("Current" + PositionCurrentFrameLeftHand);
|
||||||
@@ -52,7 +53,7 @@ public class ArmSwingLocomotion : MonoBehaviour
|
|||||||
|
|
||||||
if (Time.timeSinceLevelLoad > 1f)
|
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;
|
PositionPreviousFrameLeftHand = PositionCurrentFrameLeftHand;
|
||||||
|
|||||||
38
Assets/Project Files/Scripts/Shumpei/ChangeButtonColor.cs
Normal file
38
Assets/Project Files/Scripts/Shumpei/ChangeButtonColor.cs
Normal 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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a16108a6f7081d14f9f5a046ac04b8c2
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ae634ea4fe8cb874487372a3d7c595bf
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
22
Assets/Project Files/Scripts/Shumpei/ControllLocomotion.cs
Normal file
22
Assets/Project Files/Scripts/Shumpei/ControllLocomotion.cs
Normal 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()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: ca1db91ee57976944aa22ed347811963
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
32
Assets/Project Files/Scripts/Shumpei/EnableArmSwing.cs
Normal file
32
Assets/Project Files/Scripts/Shumpei/EnableArmSwing.cs
Normal 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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/EnableArmSwing.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/EnableArmSwing.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 696a55bfea145fa4b9029ff2d359c16d
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
32
Assets/Project Files/Scripts/Shumpei/EnableDash.cs
Normal file
32
Assets/Project Files/Scripts/Shumpei/EnableDash.cs
Normal 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;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/EnableDash.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/EnableDash.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 84e3386cbd3fd2c418ecf357af19ba5f
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
28
Assets/Project Files/Scripts/Shumpei/EnableJoyStick.cs
Normal file
28
Assets/Project Files/Scripts/Shumpei/EnableJoyStick.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/EnableJoyStick.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/EnableJoyStick.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: a63e1d5bde5a60c45aa409546e55b920
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
16
Assets/Project Files/Scripts/Shumpei/EnterGameScene.cs
Normal file
16
Assets/Project Files/Scripts/Shumpei/EnterGameScene.cs
Normal 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/EnterGameScene.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/EnterGameScene.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f1114a137d02f184db2b6291d9d31cb5
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
20
Assets/Project Files/Scripts/Shumpei/ForwardDirection.cs
Normal file
20
Assets/Project Files/Scripts/Shumpei/ForwardDirection.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 01869e86b22555a449cd53043f5c4afa
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8ac280753a1d95a43a1fbcfd69708d7a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
18
Assets/Project Files/Scripts/Shumpei/PauseMenu.cs
Normal file
18
Assets/Project Files/Scripts/Shumpei/PauseMenu.cs
Normal 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()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/PauseMenu.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/PauseMenu.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 5a2662b3abecb914cad356619e832f13
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
24
Assets/Project Files/Scripts/Shumpei/Player.cs
Normal file
24
Assets/Project Files/Scripts/Shumpei/Player.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/Player.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/Player.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 6ff82a98832d12249b30083bc9ae2dd3
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
22
Assets/Project Files/Scripts/Shumpei/PlayerData.cs
Normal file
22
Assets/Project Files/Scripts/Shumpei/PlayerData.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/PlayerData.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/PlayerData.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 9cdb4de85d282744083c6d9cee4fef3c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
42
Assets/Project Files/Scripts/Shumpei/SaveSystem.cs
Normal file
42
Assets/Project Files/Scripts/Shumpei/SaveSystem.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/SaveSystem.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/SaveSystem.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 49c2ebd233ef7a547b12ce163244e30a
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -6,8 +6,8 @@ public class TriggerDoorController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
[SerializeField] private Animator myDoor = null;
|
[SerializeField] private Animator myDoor = null;
|
||||||
|
|
||||||
[SerializeField] private bool openTrigger = false;
|
[SerializeField] private bool Trigger = false;
|
||||||
[SerializeField] private bool closeTrigger = false;
|
//[SerializeField] private bool closeTrigger = false;
|
||||||
|
|
||||||
[SerializeField] private string doorOpen = "DoorOpen";
|
[SerializeField] private string doorOpen = "DoorOpen";
|
||||||
[SerializeField] private string doorClose = "DoorClose";
|
[SerializeField] private string doorClose = "DoorClose";
|
||||||
@@ -19,17 +19,26 @@ public class TriggerDoorController : MonoBehaviour
|
|||||||
if (other.CompareTag("Player"))
|
if (other.CompareTag("Player"))
|
||||||
{
|
{
|
||||||
Debug.Log("col");
|
Debug.Log("col");
|
||||||
if (openTrigger)
|
if (Trigger)
|
||||||
{
|
{
|
||||||
Debug.Log("open");
|
Debug.Log("open");
|
||||||
myDoor.Play(doorOpen, 0, 0.0f);
|
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);
|
myDoor.Play(doorClose, 0, 0.0f);
|
||||||
gameObject.SetActive(false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
45
Assets/Project Files/Scripts/Shumpei/XRGUI.cs
Normal file
45
Assets/Project Files/Scripts/Shumpei/XRGUI.cs
Normal 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()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Project Files/Scripts/Shumpei/XRGUI.cs.meta
Normal file
11
Assets/Project Files/Scripts/Shumpei/XRGUI.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 37cfb6899ccd00b4280ac4eb92f84851
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
9586
Assets/Scenes/Shumpei/GameScene.unity
Normal file
9586
Assets/Scenes/Shumpei/GameScene.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/Shumpei/GameScene.unity.meta
Normal file
7
Assets/Scenes/Shumpei/GameScene.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8fd0e18070efeda42bb8ab22afe4a9fb
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
23410
Assets/Scenes/Shumpei/MenuScene.unity
Normal file
23410
Assets/Scenes/Shumpei/MenuScene.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/Scenes/Shumpei/MenuScene.unity.meta
Normal file
7
Assets/Scenes/Shumpei/MenuScene.unity.meta
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: e45278868e3d39f45929cb5142b6c572
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -6,11 +6,14 @@ EditorBuildSettings:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_Scenes:
|
m_Scenes:
|
||||||
- enabled: 0
|
- enabled: 0
|
||||||
path: Assets/Scenes/DO_NOT_TOUCH.unity
|
path: Assets/SimpleNaturePack/Scenes/DO_NOT_TOUCH.unity
|
||||||
guid: 9fc0d4010bbf28b4594072e72b8655ab
|
guid: 9fc0d4010bbf28b4594072e72b8655ab
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/JoonasP/SampleScene.unity
|
path: Assets/Scenes/JoonasP/SampleScene.unity
|
||||||
guid: 84eaff0e1a543c244920ec3c1b11b50f
|
guid: 84eaff0e1a543c244920ec3c1b11b50f
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/Scenes/Shumpei/GameScene.unity
|
||||||
|
guid: 8fd0e18070efeda42bb8ab22afe4a9fb
|
||||||
m_configObjects:
|
m_configObjects:
|
||||||
Unity.XR.Oculus.Settings: {fileID: 11400000, guid: bfa1182bd221b4ca89619141f66f1260,
|
Unity.XR.Oculus.Settings: {fileID: 11400000, guid: bfa1182bd221b4ca89619141f66f1260,
|
||||||
type: 2}
|
type: 2}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ TagManager:
|
|||||||
- Throwable
|
- Throwable
|
||||||
- Bullet
|
- Bullet
|
||||||
- IceBolt
|
- IceBolt
|
||||||
|
- Hand
|
||||||
layers:
|
layers:
|
||||||
- Default
|
- Default
|
||||||
- TransparentFX
|
- TransparentFX
|
||||||
|
|||||||
Reference in New Issue
Block a user