Browse Source

Added lastHeld property to YeetHandle, which tracks last GameObject that held it

develop
MrJDunn 3 years ago
parent
commit
399c6716e7
2 changed files with 3 additions and 0 deletions
  1. +1
    -0
      Assets/Scripts/Behaviours/YeetController.cs
  2. +2
    -0
      Assets/Scripts/Behaviours/YeetHandle.cs

+ 1
- 0
Assets/Scripts/Behaviours/YeetController.cs View File

@ -43,6 +43,7 @@ public class YeetController : InputBehaviour
_child = child; _child = child;
_child.transform.parent = parent.transform; _child.transform.parent = parent.transform;
_child.GetComponent<YeetHandle>().held = true; _child.GetComponent<YeetHandle>().held = true;
_child.GetComponent<YeetHandle>().lastHeld = parent;
yeetState = YeetState.Held; yeetState = YeetState.Held;

+ 2
- 0
Assets/Scripts/Behaviours/YeetHandle.cs View File

@ -8,6 +8,8 @@ public class YeetHandle : MonoBehaviour
public bool held { get; set; } public bool held { get; set; }
public GameObject lastHeld { get; set; }
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
{ {

Loading…
Cancel
Save