Merge pull request #2 from nugamestudioclub/item-pickup

Updated aim
This commit is contained in:
Marco S. Hampel 2023-04-03 20:04:21 -04:00 committed by GitHub
commit 6813e232c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 557 additions and 177 deletions

View File

@ -139,7 +139,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0 m_ExitTime: 0
m_HasExitTime: 0 m_HasExitTime: 0
@ -191,7 +191,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.87288135 m_ExitTime: 0.87288135
m_HasExitTime: 0 m_HasExitTime: 0
@ -727,7 +727,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.6428572 m_ExitTime: 0.6428572
m_HasExitTime: 0 m_HasExitTime: 0
@ -806,7 +806,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.87288135 m_ExitTime: 0.87288135
m_HasExitTime: 0 m_HasExitTime: 0
@ -972,7 +972,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0.975 m_ExitTime: 0.975
m_HasExitTime: 0 m_HasExitTime: 0
@ -1078,7 +1078,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0 m_ExitTime: 0
m_HasExitTime: 0 m_HasExitTime: 0
@ -1437,7 +1437,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0 m_ExitTime: 0
m_HasExitTime: 0 m_HasExitTime: 0
@ -1535,7 +1535,7 @@ AnimatorStateTransition:
m_Mute: 0 m_Mute: 0
m_IsExit: 0 m_IsExit: 0
serializedVersion: 3 serializedVersion: 3
m_TransitionDuration: 0.25 m_TransitionDuration: 0.1
m_TransitionOffset: 0 m_TransitionOffset: 0
m_ExitTime: 0 m_ExitTime: 0
m_HasExitTime: 0 m_HasExitTime: 0

View File

@ -1578,11 +1578,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: -0.060561996 value: -0.06056196
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0.015478803 value: 0.0154787935
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
@ -1594,11 +1594,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: -0.060832795 value: -0.060832832
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0.014377562 value: 0.014377572
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318978543542555, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318978543542555, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
@ -1622,11 +1622,11 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318978543542555, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318978543542555, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: -0.061787855 value: -0.061787784
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318978543542555, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318978543542555, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0.009466156 value: 0.009466145
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 1307405647097536171, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 1307405647097536171, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
@ -2449,7 +2449,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!114 &1145314264 --- !u!114 &1145314264
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -4474,6 +4474,18 @@ PrefabInstance:
propertyPath: m_Center.y propertyPath: m_Center.y
value: -0.2740825 value: -0.2740825
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318976786001927, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318976786001927, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318976786001927, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318976786001927, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318976786001927, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 0.99545825 value: 0.99545825
@ -4538,6 +4550,30 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: AstronautWithCamera value: AstronautWithCamera
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318977167042204, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_DistanceLimit
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318977167042207, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.y
value: 1.32
objectReference: {fileID: 0}
- target: {fileID: 365318977167042207, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.z
value: -3
objectReference: {fileID: 0}
- target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318977785173342, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 0.9965996 value: 0.9965996
@ -4554,6 +4590,34 @@ PrefabInstance:
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: 0.0154787935 value: 0.0154787935
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 365318977786174402, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LookaheadTime
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318977786174402, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_SoftZoneWidth
value: 0.8
objectReference: {fileID: 0}
- target: {fileID: 365318977786174402, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_VerticalDamping
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318977786174402, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_HorizontalDamping
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 365318978058098911, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 0.9974095 value: 0.9974095
@ -4646,10 +4710,26 @@ PrefabInstance:
propertyPath: pistol propertyPath: pistol
value: value:
objectReference: {fileID: 1000589093} objectReference: {fileID: 1000589093}
- target: {fileID: 2641769993692704567, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_text
value: Health:10
objectReference: {fileID: 0}
- target: {fileID: 2641769993692704567, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_fontSize
value: 29.8
objectReference: {fileID: 0}
- target: {fileID: 2641769993692704567, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_fontStyle
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2641769993692704567, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 2641769993692704567, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_enableWordWrapping propertyPath: m_enableWordWrapping
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 2641769993692704567, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: m_overrideHtmlColors
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3430889494742284928, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3} - target: {fileID: 3430889494742284928, guid: 57a1e0f3274302943993b8f55e87f3c9, type: 3}
propertyPath: firePower propertyPath: firePower
value: 40 value: 40
@ -4785,7 +4865,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1003663202} m_GameObject: {fileID: 1003663202}
m_LocalRotation: {x: 0.5816941, y: -0, z: -0, w: 0.8134076} m_LocalRotation: {x: 0.5816941, y: -0, z: -0, w: 0.8134076}
m_LocalPosition: {x: 0.33358335, y: 3.54, z: 7.84} m_LocalPosition: {x: 0.33358335, y: 3.54, z: 31.72}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -9343,7 +9423,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!114 &2073197277 --- !u!114 &2073197277
MonoBehaviour: MonoBehaviour:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -53,36 +53,9 @@ public class PlayerInteractionHandler : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
if (itemSelector == null)
{
itemSelector = ItemSelector.instance;
}
if (useItemSelector)
{
InteractableItem item = this.itemSelector.Selected;
if(item != null)
{
if (item is HeavyInteractableItem)
{
heavyItemsInRange = new List<HeavyInteractableItem>() { (HeavyInteractableItem)item };
itemsInRange = new List<InteractableItem> { item };
print("Item:" + item.name);
}
else
{
itemsInRange = new List<InteractableItem> { item };
heavyItemsInRange = new List<HeavyInteractableItem>();
}
}
else
{
itemsInRange = new List<InteractableItem>();
heavyItemsInRange = new List<HeavyInteractableItem>();
}
}
if(Input.GetButtonDown("Fire1")) if(Input.GetButtonDown("Fire1"))
{ {
if (this.GunEnabled) if (this.GunEnabled)
@ -218,7 +191,7 @@ public class PlayerInteractionHandler : MonoBehaviour
private void OnTriggerEnter(Collider other) private void OnTriggerEnter(Collider other)
{ {
/* if(other.gameObject.GetComponent<InteractableItem>() != null) if(other.gameObject.GetComponent<InteractableItem>() != null)
{ {
InteractableItem item = other.gameObject.GetComponent<InteractableItem>(); InteractableItem item = other.gameObject.GetComponent<InteractableItem>();
if(item is InteractableItem && item is not HeavyInteractableItem) if(item is InteractableItem && item is not HeavyInteractableItem)
@ -231,11 +204,11 @@ public class PlayerInteractionHandler : MonoBehaviour
heavyItemsInRange.Add((HeavyInteractableItem)item); heavyItemsInRange.Add((HeavyInteractableItem)item);
} }
}*/ }
} }
private void OnTriggerExit(Collider other) private void OnTriggerExit(Collider other)
{ {
/*if (other.gameObject.GetComponent<InteractableItem>() != null) if (other.gameObject.GetComponent<InteractableItem>() != null)
{ {
InteractableItem item = other.gameObject.GetComponent<InteractableItem>(); InteractableItem item = other.gameObject.GetComponent<InteractableItem>();
if (item is InteractableItem && item is not HeavyInteractableItem) if (item is InteractableItem && item is not HeavyInteractableItem)
@ -250,6 +223,6 @@ public class PlayerInteractionHandler : MonoBehaviour
//itemsInRange.Remove((HeavyInteractableItem)(item)); //itemsInRange.Remove((HeavyInteractableItem)(item));
heavyItemsInRange.Remove((HeavyInteractableItem)item); heavyItemsInRange.Remove((HeavyInteractableItem)item);
} }
}*/ }
} }
} }