Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Assets/Prefabs/Target.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ CapsuleCollider:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_IsTrigger: 1
m_IsTrigger: 0
m_ProvidesContacts: 0
m_Enabled: 1
serializedVersion: 2
Expand Down
44 changes: 30 additions & 14 deletions Assets/Scenes/NatureScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,10 @@ PrefabInstance:
propertyPath: m_Name
value: Tree_04
objectReference: {fileID: 0}
- target: {fileID: 5942433330446073732, guid: f0c16f0ea935ea64297ca1d4d55d9746, type: 3}
propertyPath: m_LODs.Array.data[1].screenRelativeHeight
value: 0.0055446276
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
Expand Down Expand Up @@ -1511,7 +1515,7 @@ Transform:
m_GameObject: {fileID: 129418382}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: -0.08}
m_LocalPosition: {x: 0.34, y: 0, z: -0.08}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -2384,6 +2388,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5096517541735811467, guid: c60edd51c065ceb46b345849a03bc106, type: 3}
propertyPath: m_LODs.Array.data[1].screenRelativeHeight
value: 0.00045941176
objectReference: {fileID: 0}
- target: {fileID: 6941765000743290380, guid: c60edd51c065ceb46b345849a03bc106, type: 3}
propertyPath: m_Name
value: Tree_03 (3)
Expand Down Expand Up @@ -9961,7 +9969,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1847768278983476760, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalPosition.x
Expand All @@ -9977,27 +9985,27 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalRotation.w
value: -0.24970774
value: -0.4320856
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalRotation.x
value: 0.079932086
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalRotation.y
value: -0.9190777
value: 0.90183264
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalRotation.z
value: -0.2941991
value: -0
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: -35.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: -210.4
value: 231.2
objectReference: {fileID: 0}
- target: {fileID: 5024733077653106566, guid: d020e8a44de3efd458bb849ecdb210d5, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
Expand Down Expand Up @@ -11701,6 +11709,10 @@ PrefabInstance:
propertyPath: m_Name
value: Tree_04 (6)
objectReference: {fileID: 0}
- target: {fileID: 5942433330446073732, guid: f0c16f0ea935ea64297ca1d4d55d9746, type: 3}
propertyPath: m_LODs.Array.data[1].screenRelativeHeight
value: 0.0019087236
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
Expand Down Expand Up @@ -13175,7 +13187,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &2079483091
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -13692,6 +13704,10 @@ PrefabInstance:
propertyPath: debugCube
value:
objectReference: {fileID: 709881062}
- target: {fileID: 4324286136567874797, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: arrowNotch
value:
objectReference: {fileID: 129418382}
- target: {fileID: 4642036980616804171, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_Materials.Array.data[0]
value:
Expand Down Expand Up @@ -13778,27 +13794,27 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalPosition.x
value: 1.53
value: 6.69
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalPosition.y
value: 1.465
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalPosition.z
value: -3.34
value: 10.28
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalRotation.w
value: 1
value: 0.88502836
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: 0.46553722
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalRotation.z
Expand All @@ -13810,7 +13826,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
value: 55.49
objectReference: {fileID: 0}
- target: {fileID: 5587657699232216974, guid: 2e0ac17f260ba744aa450dd79334386a, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/ArrowSpawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void UpdateArrow(float pullDistance)
{
if(isArrowReady== true)
{
currentArrow.transform.localPosition = new Vector3(0, 0, 0 + pullDistance); //TODO Adjust this for arrow alignment to string
currentArrow.transform.localPosition = new Vector3(0 + (pullDistance/3), 0, 0); //TODO Adjust this for arrow alignment to string

}
}
Expand All @@ -71,6 +71,8 @@ private IEnumerator DelayedSpawn()
currentArrow = Instantiate(arrow, this.gameObject.transform);
currentArrow.transform.position = new Vector3(arrowNotch.transform.position.x, arrowNotch.transform.position.y, arrowNotch.transform.position.z - 0.22f);
currentArrow.transform.rotation = arrowNotch.transform.rotation;

currentArrow.transform.SetParent(arrowNotch.transform, true);
Debug.Log("Arrow is ready");
currentArrow.transform.position = arrowNotch.transform.position;
}
Expand Down
5 changes: 3 additions & 2 deletions Assets/Scripts/BowDebugger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ void Update()
if(Keyboard.current.bKey.isPressed && bKeyPressed == false)
{
bKeyPressed = true;
pullString.pullDistance = 1;
pullString.pullDistance += 0.1f;
pullString.UpdateString();

StartCoroutine("KeyDelay");

}

}
Expand Down
8 changes: 5 additions & 3 deletions Assets/Scripts/PullString.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,14 @@ public float CalculatePull(Vector3 pullPosition)

public void UpdateString()
{
Vector3 linePosition = Vector3.right * Mathf.Lerp(startPoint.transform.localPosition.x, endPoint.transform.localPosition.x, pullDistance);
debugCube.ChangeText2(pullDistance.ToString());
Vector3 linePosition = Vector3.right * Mathf.Lerp(startPoint.transform.localPosition.x, endPoint.transform.localPosition.x, pullDistance) + new Vector3(0,0, -0.1f);
debugCube.ChangeText2(linePosition.x.ToString());
lineRenderer.SetPosition(1, linePosition);

//arrowNotch.transform.position = Vector3.left * (arrowNotch.transform.position.x - linePosition.x);

//arrowSpawner.UpdateArrow(pullDistance);

//arrowSpawner.UpdateArrow(linePosition.x);

}

Expand Down