Browse Source

Picking up random objects

feature/RoundManager
MrJDunn 3 years ago
parent
commit
e27b79be0a
4 changed files with 135 additions and 4 deletions
  1. BIN
      Assets/Scenes/Testing Scenes/YeetScene.unity
  2. +16
    -2
      Assets/Scripts/Player Scripts/PlayerInputController.cs
  3. +110
    -0
      Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab
  4. +7
    -0
      Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab.meta

BIN
Assets/Scenes/Testing Scenes/YeetScene.unity (Stored with Git LFS) View File

size 15783

+ 16
- 2
Assets/Scripts/Player Scripts/PlayerInputController.cs View File

@ -30,7 +30,7 @@ public class PlayerInputController : MonoBehaviour
private YeetController m_yeetController;
public GameObject testChild;
public GameObject child;
public GameObject body;
private void Awake()
@ -38,6 +38,8 @@ public class PlayerInputController : MonoBehaviour
m_input = GetComponent<PlayerInput>();
m_controller = GetComponent<CharacterController>();
m_yeetController = GetComponent<YeetController>();
body = this.gameObject;
}
@ -54,13 +56,25 @@ public class PlayerInputController : MonoBehaviour
m_desiredDirection = new Vector3(m_recievedInput.x, 0.0f, m_recievedInput.y);
}
private void OnTriggerEnter(Collider collider)
{
Debug.Log("Bang!");
child = collider.gameObject;
}
private void OnTriggerExit(Collider collider)
{
child = null;
}
private void OnYeet()
{
m_yeetController.parent = body;
switch (m_yeetController.yeetState)
{
case YeetController.YeetState.Unheld:
m_yeetController.Hold(testChild);
if(child)
m_yeetController.Hold(child);
// Grab nearest baby
break;
case YeetController.YeetState.Held:

+ 110
- 0
Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab View File

@ -0,0 +1,110 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1051237570
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 33932531309654967}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 188bb300967eea14fb681a94fc31f911, type: 3}
m_Name:
m_EditorClassIdentifier:
yeetVelocity: 10
yeetDuration: 2
--- !u!1001 &2714160732044909285
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 2725293204815276921, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 2725293204815276924, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 2725293204815276924, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_Convex
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2725293204815276924, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_IsTrigger
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293204815276927, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_Mesh
value:
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018834, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_Name
value: YeetyPlayer Variant
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalPosition.x
value: 1.2684288
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalPosition.z
value: -6.7718506
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018844, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018846, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: m_SlopeLimit
value: 90
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018847, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: body
value:
objectReference: {fileID: 0}
- target: {fileID: 2725293205319018847, guid: 47d3f018734864140ba302f6972ba575, type: 3}
propertyPath: testChild
value:
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 47d3f018734864140ba302f6972ba575, type: 3}
--- !u!1 &33932531309654967 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 2725293205319018834, guid: 47d3f018734864140ba302f6972ba575, type: 3}
m_PrefabInstance: {fileID: 2714160732044909285}
m_PrefabAsset: {fileID: 0}

+ 7
- 0
Assets/World Assets/Prefabs/YeetyPlayer Variant.prefab.meta View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c3cc089e72190e74aab4c6592121b553
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save