Added custom cursor
This commit is contained in:
@@ -9,6 +9,7 @@ GameObject:
|
|||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 6997620146033860791}
|
- component: {fileID: 6997620146033860791}
|
||||||
|
- component: {fileID: 3265567963809100238}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Cursor
|
m_Name: Cursor
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@@ -26,12 +27,27 @@ Transform:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 0.1, y: 0.1, z: 0.1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 1
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 7297418410848169550}
|
- {fileID: 7297418410848169550}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 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
|
--- !u!1001 &7119938247261505957
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@@ -633,6 +633,7 @@ Transform:
|
|||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1003288350}
|
- {fileID: 1003288350}
|
||||||
|
- {fileID: 1557857216}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!4 &1003288350 stripped
|
--- !u!4 &1003288350 stripped
|
||||||
@@ -1195,6 +1196,85 @@ MonoBehaviour:
|
|||||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
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: 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}
|
||||||
|
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
|
--- !u!1001 &1758685209
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@@ -1203,6 +1283,11 @@ PrefabInstance:
|
|||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_TransformParent: {fileID: 0}
|
m_TransformParent: {fileID: 0}
|
||||||
m_Modifications:
|
m_Modifications:
|
||||||
|
- target: {fileID: 1912500691838987139, guid: e29ce1fe47a855c4e907d4312c9e9d6e,
|
||||||
|
type: 3}
|
||||||
|
propertyPath: m_IsActive
|
||||||
|
value: 0
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2020022267469913571, guid: e29ce1fe47a855c4e907d4312c9e9d6e,
|
- target: {fileID: 2020022267469913571, guid: e29ce1fe47a855c4e907d4312c9e9d6e,
|
||||||
type: 3}
|
type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
|
|||||||
27
Assets/Scripts/FakeCursor.cs
Normal file
27
Assets/Scripts/FakeCursor.cs
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
Assets/Scripts/FakeCursor.cs.meta
Normal file
11
Assets/Scripts/FakeCursor.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 353f192b40556e34dada2d432a9ffa85
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@@ -27,8 +27,6 @@ namespace InterfaceOff.WorldScene
|
|||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
/* Hides the cursor as a custom one is used */
|
|
||||||
|
|
||||||
/* Loads the JSON, temporary. TODO: Insert the JSON into this .cs file */
|
/* Loads the JSON, temporary. TODO: Insert the JSON into this .cs file */
|
||||||
string json = File.ReadAllText(Application.dataPath + "/Resources/playerframe.json");
|
string json = File.ReadAllText(Application.dataPath + "/Resources/playerframe.json");
|
||||||
Frames = JsonUtility.FromJson<PlayerFrameInfoArray>(json).FrameInfo;
|
Frames = JsonUtility.FromJson<PlayerFrameInfoArray>(json).FrameInfo;
|
||||||
|
|||||||
Reference in New Issue
Block a user