mirror of
https://github.com/nothke/quality-control.git
synced 2024-11-12 22:03:42 +00:00
20 lines
449 B
C#
20 lines
449 B
C#
using Nothke.Interaction;
|
|
using Nothke.Interaction.Items;
|
|
using UnityEngine;
|
|
|
|
public class HammerableRigidbody : RigidbodyInteractable
|
|
{
|
|
public void Hammer()
|
|
{
|
|
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));
|
|
}
|
|
} |