diff --git a/Assets/Prefabs/Art3D/Cursor.prefab b/Assets/Prefabs/Art3D/Cursor.prefab index 49aae58..c86ad74 100644 --- a/Assets/Prefabs/Art3D/Cursor.prefab +++ b/Assets/Prefabs/Art3D/Cursor.prefab @@ -9,6 +9,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6997620146033860791} + - component: {fileID: 3265567963809100238} m_Layer: 0 m_Name: Cursor m_TagString: Untagged @@ -26,12 +27,27 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 + m_LocalScale: {x: 0.1, y: 0.1, z: 0.1} + m_ConstrainProportionsScale: 1 m_Children: - {fileID: 7297418410848169550} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3265567963809100238 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7563216493506774349} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 353f192b40556e34dada2d432a9ffa85, type: 3} + m_Name: + m_EditorClassIdentifier: + AttachedCamera: {fileID: 0} + ZValue: 8 + Scale: 15 --- !u!1001 &7119938247261505957 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/WorldScene.unity b/Assets/Scenes/WorldScene.unity index 1ba4745..b8e3dea 100644 --- a/Assets/Scenes/WorldScene.unity +++ b/Assets/Scenes/WorldScene.unity @@ -633,6 +633,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 1003288350} + - {fileID: 1557857216} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!4 &1003288350 stripped @@ -1195,6 +1196,100 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} m_Name: m_EditorClassIdentifier: +--- !u!1001 &1557857215 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + serializedVersion: 3 + m_TransformParent: {fileID: 782229191} + m_Modifications: + - target: {fileID: 3265567963809100238, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: Scale + value: 15 + objectReference: {fileID: 0} + - target: {fileID: 3265567963809100238, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: ZValue + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 3265567963809100238, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: AttachedCamera + value: + objectReference: {fileID: 782229189} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalPosition.z + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalRotation.w + value: 0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalRotation.y + value: -0.7071068 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: -90 + objectReference: {fileID: 0} + - target: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7563216493506774349, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_Name + value: Cursor + objectReference: {fileID: 0} + - target: {fileID: 7563216493506774349, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_RemovedGameObjects: [] + m_AddedGameObjects: [] + m_AddedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 15c9da29f34c88d4c82acf24cc874e3b, type: 3} +--- !u!4 &1557857216 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6997620146033860791, guid: 15c9da29f34c88d4c82acf24cc874e3b, + type: 3} + m_PrefabInstance: {fileID: 1557857215} + m_PrefabAsset: {fileID: 0} --- !u!1001 &1758685209 PrefabInstance: m_ObjectHideFlags: 0 @@ -1203,6 +1298,11 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 1912500691838987139, guid: e29ce1fe47a855c4e907d4312c9e9d6e, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2020022267469913571, guid: e29ce1fe47a855c4e907d4312c9e9d6e, type: 3} propertyPath: m_Name diff --git a/Assets/Scripts/FakeCursor.cs b/Assets/Scripts/FakeCursor.cs new file mode 100644 index 0000000..1da1fb5 --- /dev/null +++ b/Assets/Scripts/FakeCursor.cs @@ -0,0 +1,27 @@ +using UnityEngine; + +public class FakeCursor : MonoBehaviour +{ + public Camera AttachedCamera; + + private void Start() + { + Cursor.visible = false; + } + + private void Update() + { + Vector3 absolutePosition = new() + { + x = Input.mousePosition.x / Screen.width * 1920, + y = Input.mousePosition.y / Screen.height * 1080, + z = 5f + }; + transform.position = AttachedCamera.ScreenToWorldPoint(absolutePosition); + } + + private void OnDestroy() + { + Cursor.visible = true; + } +} diff --git a/Assets/Scripts/FakeCursor.cs.meta b/Assets/Scripts/FakeCursor.cs.meta new file mode 100644 index 0000000..00bcf7c --- /dev/null +++ b/Assets/Scripts/FakeCursor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 353f192b40556e34dada2d432a9ffa85 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index dcbc2aa..90f0c8b 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -27,8 +27,6 @@ namespace InterfaceOff.WorldScene private void Awake() { - /* Hides the cursor as a custom one is used */ - /* Loads the JSON, temporary. TODO: Insert the JSON into this .cs file */ string json = File.ReadAllText(Application.dataPath + "/Resources/playerframe.json"); Frames = JsonUtility.FromJson(json).FrameInfo;