diff --git a/Assets/Models/Tesla.fbx b/Assets/Models/Tesla.fbx index 5fb4c16..d1720bd 100644 Binary files a/Assets/Models/Tesla.fbx and b/Assets/Models/Tesla.fbx differ diff --git a/Assets/Scenes/TowerTest.unity b/Assets/Scenes/TowerTest.unity index 916a80f..6fa990d 100644 --- a/Assets/Scenes/TowerTest.unity +++ b/Assets/Scenes/TowerTest.unity @@ -414,74 +414,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} ---- !u!1001 &658701657 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 1415246146501367120, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_Name - value: Gripper - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalPosition.x - value: 1.22 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalPosition.y - value: 0.517 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalPosition.z - value: -0.14 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 1794726729777156074, guid: 91554800af50ec827822f376e2fc5f64, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 91554800af50ec827822f376e2fc5f64, type: 3} --- !u!1 &769011490 GameObject: m_ObjectHideFlags: 0 @@ -644,6 +576,11 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 1491457165970948004, guid: 9415cb10a1bd579269301ca4f61a1554, + type: 3} + propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.size + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7437064479105606814, guid: 9415cb10a1bd579269301ca4f61a1554, type: 3} propertyPath: trajectoryBounces @@ -960,6 +897,10 @@ MonoBehaviour: m_EditorClassIdentifier: Balance: 0 IsBuildMode: 0 + ShopSelectedTower: + name: + price: 0 + prefab: {fileID: 0} --- !u!4 &1395991987 Transform: m_ObjectHideFlags: 0 @@ -1080,74 +1021,6 @@ Transform: m_Children: [] m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: -90, y: 0, z: 0} ---- !u!1001 &1671091699 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalPosition.x - value: 3.934035 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalPosition.y - value: 0.15400258 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalPosition.z - value: -5.620848 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: -8679921383154817045, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 919132149155446097, guid: 72980d1326f21c0ffa34ea09162d1234, - type: 3} - propertyPath: m_Name - value: Tesla - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 72980d1326f21c0ffa34ea09162d1234, type: 3} --- !u!1001 &1732242001 PrefabInstance: m_ObjectHideFlags: 0 @@ -1294,7 +1167,7 @@ PrefabInstance: - target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc, type: 3} propertyPath: m_LocalRotation.w - value: -0.1380528 + value: -0.13805284 objectReference: {fileID: 0} - target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc, type: 3} @@ -1309,7 +1182,7 @@ PrefabInstance: - target: {fileID: 7348612162646443967, guid: fd9f9b61c0ebb324ebc9f929e26706bc, type: 3} propertyPath: m_LocalRotation.z - value: -0.13815574 + value: -0.13815573 objectReference: {fileID: 0} - target: {fileID: 8882344377078016156, guid: fd9f9b61c0ebb324ebc9f929e26706bc, type: 3} @@ -1506,84 +1379,6 @@ Camera: type: 3} m_PrefabInstance: {fileID: 1732242001} m_PrefabAsset: {fileID: 0} ---- !u!1001 &2047642824 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalPosition.x - value: 2.33 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalPosition.y - value: 0.08219504 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalPosition.z - value: 0.07 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 269373318190900745, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 645933633211530419, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: m_Name - value: MrLazer - objectReference: {fileID: 0} - - target: {fileID: 7605001933718563855, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: startHealth - value: 1e+14 - objectReference: {fileID: 0} - - target: {fileID: 7605001933718563855, guid: 4e5e3131ea2a78cfd93219be3806da6d, - type: 3} - propertyPath: OnHealthZero.m_PersistentCalls.m_Calls.Array.size - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 4e5e3131ea2a78cfd93219be3806da6d, type: 3} --- !u!1001 &667212637924654954 PrefabInstance: m_ObjectHideFlags: 0 @@ -1667,8 +1462,5 @@ SceneRoots: - {fileID: 1621186633} - {fileID: 1797347352} - {fileID: 1732242001} - - {fileID: 1671091699} - {fileID: 504816165} - {fileID: 1395991987} - - {fileID: 658701657} - - {fileID: 2047642824} diff --git a/Assets/Scripts/Utilities/EditableArc.cs b/Assets/Scripts/Utilities/EditableArc.cs index 829afb2..c69e0ce 100644 --- a/Assets/Scripts/Utilities/EditableArc.cs +++ b/Assets/Scripts/Utilities/EditableArc.cs @@ -81,9 +81,13 @@ public class EditableArc : MonoBehaviour arcTangent.x *= -1f; Debug.DrawRay(knob.transform.position, arcTangent3D, Color.yellow, 5f); + Vector3 screenRay = Camera.main.ScreenPointToRay(Input.mousePosition).direction; + Vector3 barreltToAim = Quaternion.AngleAxis(Value.Value, normal) * tangent; + float dot = Vector3.Dot(transform.forward, Camera.main.transform.forward) * -1f; float sign = orientation == ArcOrientation.HORIZONTAL ? 1f : -1f; - float delta = Vector2.Dot(arcTangent, mouseMovement) * knobSensitiviy * sign; + mouseMovement.y *= sign * Mathf.Sin(dot); + float delta = Vector2.Dot(arcTangent, mouseMovement) * knobSensitiviy * Mathf.Sign(dot); float newAngle = ClampAngle(Value.Value + delta, rotationMinMax.x, rotationMinMax.y); Value.Value = newAngle;