Skip to content

Commit

Permalink
equip bow prefab
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelKolodziej committed Jun 8, 2023
1 parent 2ecebb7 commit eff53e2
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 205 deletions.
20 changes: 10 additions & 10 deletions Assets/Game/PickUps/Bow pickup.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -78,43 +78,43 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalPosition.x
value: 0
value: -0.225
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalPosition.y
value: 0
value: 0.467
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalPosition.z
value: 0
value: -0.849
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalRotation.w
value: 1
value: 0.317619
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalRotation.x
value: 0
value: 0.111018054
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: -0.52289766
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalRotation.z
value: 0
value: -0.78318024
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
value: -48.463
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
value: -49.744
objectReference: {fileID: 0}
- target: {fileID: 4802493755022875481, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
value: -112.279
objectReference: {fileID: 0}
- target: {fileID: 8101199671442424349, guid: 269a5dde91b9530479356da824f5acbf, type: 3}
propertyPath: m_Name
Expand Down
163 changes: 0 additions & 163 deletions Assets/Game/PickUps/Equipped Bow.prefab

This file was deleted.

7 changes: 0 additions & 7 deletions Assets/Game/PickUps/Equipped Bow.prefab.meta

This file was deleted.

2 changes: 1 addition & 1 deletion Assets/Game/Weapons/Bow/Bow Enemy.asset
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: Bow Enemy
m_EditorClassIdentifier:
animatorOverride: {fileID: 22100000, guid: bd03dd5c01b90f948ac9fdd3fefc9d37, type: 2}
equpipedPrefab: {fileID: 5029172405624957920, guid: dae8cf1835a69a04cbd558b349cef843, type: 3}
equpipedPrefab: {fileID: 2322519323926761322, guid: dae8cf1835a69a04cbd558b349cef843, type: 3}
weaponRange: 20
weaponDamage: 0
isRightHanded: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Game/Weapons/Bow/Bow.asset
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ MonoBehaviour:
m_Name: Bow
m_EditorClassIdentifier:
animatorOverride: {fileID: 22100000, guid: bd03dd5c01b90f948ac9fdd3fefc9d37, type: 2}
equpipedPrefab: {fileID: 4837396648880528836, guid: 46656307bb17b4046ae4008e58be3428, type: 3}
equpipedPrefab: {fileID: 2322519323926761322, guid: dae8cf1835a69a04cbd558b349cef843, type: 3}
weaponRange: 15
weaponDamage: 0
isRightHanded: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Game/Weapons/Sword/Sword.asset
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ MonoBehaviour:
equpipedPrefab: {fileID: 6676521290224804715, guid: 6ede0ff8790d57242917414e790eeeb3, type: 3}
weaponRange: 4
weaponDamage: 10
isRightHanded: 0
isRightHanded: 1
projectile: {fileID: 0}
12 changes: 7 additions & 5 deletions Assets/Game/Weapons/Weapons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class Weapons : ScriptableObject

public void Spawn(Transform rightHand, Transform leftHand, Animator animator)
{
DestroyOldWeapon(rightHand, leftHand);

DestroyOldWeapon(rightHand, leftHand);

if (equpipedPrefab != null)
{
Expand All @@ -33,20 +33,22 @@ public void Spawn(Transform rightHand, Transform leftHand, Animator animator)
}
}

private void DestroyOldWeapon(Transform rightHand, Transform leftHand)
private static void DestroyOldWeapon(Transform rightHand, Transform leftHand)
{
Transform oldWeapon = rightHand.Find(weaponName);
if(oldWeapon == null)
Console.WriteLine("pickup" + oldWeapon);
if (oldWeapon == null)
{
oldWeapon = leftHand.Find(weaponName);
Console.WriteLine("pickup" + oldWeapon);
}
if (oldWeapon == null) return;

oldWeapon.name = "Destroying";
oldWeapon.name = "DESTROYING";
Destroy(oldWeapon.gameObject);

}


private Transform GetTransform(Transform rightHand, Transform leftHand)
{
Transform handTransform;
Expand Down
34 changes: 21 additions & 13 deletions Assets/Scenes/Sandbox/SampleScene2.unity
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ PrefabInstance:
propertyPath: m_Name
value: Portal
objectReference: {fileID: 0}
- target: {fileID: 1721553746408384444, guid: c5b504a31fb066f41948b6bbfcb64c97, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2016872397967707590, guid: c5b504a31fb066f41948b6bbfcb64c97, type: 3}
propertyPath: destination
value: 0
Expand Down Expand Up @@ -1358,43 +1362,43 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4904399729703606452, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_ScreenX
value: 0.5016392
value: 0.4943073
objectReference: {fileID: 0}
- target: {fileID: 4904399729703606452, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_ScreenY
value: 0.4933849
value: 0.5406824
objectReference: {fileID: 0}
- target: {fileID: 4904399729703606452, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LookaheadTime
value: 0.228
value: 0.35
objectReference: {fileID: 0}
- target: {fileID: 4904399729703606452, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_SoftZoneWidth
value: 0.8025543
objectReference: {fileID: 0}
- target: {fileID: 4904399729703606452, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_CameraDistance
value: 14.74
value: 5.98
objectReference: {fileID: 0}
- target: {fileID: 4904399729703606452, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_DeadZoneHeight
value: 0.29
objectReference: {fileID: 0}
- target: {fileID: 4904399729703606452, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_TrackedObjectOffset.y
value: 0.11
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5584080860306864857, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalPosition.x
value: -29.729828
value: -34.569656
objectReference: {fileID: 0}
- target: {fileID: 5584080860306864857, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalPosition.y
value: 14.17609
value: 9.898893
objectReference: {fileID: 0}
- target: {fileID: 5584080860306864857, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalPosition.z
value: 166.50179
value: 172.50307
objectReference: {fileID: 0}
- target: {fileID: 5584080860306864857, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalRotation.w
Expand All @@ -1415,7 +1419,7 @@ PrefabInstance:
- target: {fileID: 5612484952537521235, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: defaultWeapon
value:
objectReference: {fileID: 11400000, guid: 1fdea813c6cacd548bb86d49da957e68, type: 2}
objectReference: {fileID: 11400000, guid: f43f6573ccd6b274e97d8f02dfa79587, type: 2}
- target: {fileID: 5612484952537521235, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: handTransform
value:
Expand Down Expand Up @@ -1446,15 +1450,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8155141456973853842, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalPosition.x
value: -29.729828
value: -34.569656
objectReference: {fileID: 0}
- target: {fileID: 8155141456973853842, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalPosition.y
value: 14.17609
value: 9.898893
objectReference: {fileID: 0}
- target: {fileID: 8155141456973853842, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalPosition.z
value: 166.50179
value: 172.50307
objectReference: {fileID: 0}
- target: {fileID: 8155141456973853842, guid: c1f5a3649aa42f2488c5fb745bdd5a1b, type: 3}
propertyPath: m_LocalRotation.w
Expand Down Expand Up @@ -1655,9 +1659,13 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 956729039}
m_Modifications:
- target: {fileID: 159634379208014710, guid: dae8cf1835a69a04cbd558b349cef843, type: 3}
propertyPath: m_LocalPosition.y
value: 0.65
objectReference: {fileID: 0}
- target: {fileID: 1365685289177011758, guid: dae8cf1835a69a04cbd558b349cef843, type: 3}
propertyPath: m_RootOrder
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1365685289177011758, guid: dae8cf1835a69a04cbd558b349cef843, type: 3}
propertyPath: m_LocalPosition.x
Expand Down
Loading

0 comments on commit eff53e2

Please sign in to comment.