30 lines
702 B
C#
30 lines
702 B
C#
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;
|
|
}
|
|
}
|
|
} |