diff --git a/TempScriptsFolder/PickAndThrow.cs b/TempScriptsFolder/PickAndThrow.cs new file mode 100644 index 00000000..834a508c --- /dev/null +++ b/TempScriptsFolder/PickAndThrow.cs @@ -0,0 +1,30 @@ +using SHADE; +using System; +using static PlayerController; + +public class PickAndThrow : Script +{ + private PlayerController pc; + public uint itemEID; + Transform itemHoldLocation; + public PickAndThrow(GameObject gameObj) : base(gameObj) { } + protected override void awake() + { + pc = GetScript(); + itemHoldLocation = GetComponentInChildren(); + } + protected override void update() + { + if (pc != null && pc.holdItem) + { + } + } + protected override void onCollisionEnter(CollisionInfo info) + { + if (info.GameObject.Name == "item" && Input.GetKey(Input.KeyCode.E)) + { + pc.holdItem = true; + itemEID = info.GameObject.EntityId; + } + } +} \ No newline at end of file diff --git a/TempScriptsFolder/PlayerController.cs b/TempScriptsFolder/PlayerController.cs index 0d374bae..36e19860 100644 --- a/TempScriptsFolder/PlayerController.cs +++ b/TempScriptsFolder/PlayerController.cs @@ -22,6 +22,7 @@ public class PlayerController : Script //to be remove public float drag = 2.0f; + public bool holdItem = false; [SerializeField] [Tooltip("The current state fo the raccoon")] public RaccoonStates currentState = RaccoonStates.IDILE;