Right click hammer time!

This commit is contained in:
nothke
2024-08-20 00:20:33 +02:00
parent 71f05400e4
commit 965e207eb4
5 changed files with 49 additions and 15 deletions

View File

@@ -2,26 +2,17 @@
using Nothke.Interaction.Items;
using UnityEngine;
public class HammerableRigidbody: RigidbodyInteractable
public class HammerableRigidbody : RigidbodyInteractable
{
public override void Use(InteractionController im)
public void Hammer()
{
manager = im;
if (im.hands.item == null)
{
base.Use(im);
return;
}
var product = GetComponentInChildren<Product>();
if (!product)
{
return;
}
var clip = product.Type.SelectClip(product.Defect != DefectType.None);
clip.Play(
transform.position,
Random.Range(0.8f, 1.2f));