base for pick and throw
This commit is contained in:
parent
97a39d62c6
commit
4eef6143dc
|
@ -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<PlayerController>();
|
||||
itemHoldLocation = GetComponentInChildren<Transform>();
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue