mirror of
https://github.com/nothke/quality-control.git
synced 2025-08-09 23:23:44 +00:00
Assembling Main scene.
This commit is contained in:
25
Assets/Scripts/Interactable/HammerRepair.cs
Normal file
25
Assets/Scripts/Interactable/HammerRepair.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Nothke.Interaction;
|
||||
using Nothke.Interaction.Items;
|
||||
using UnityEngine;
|
||||
|
||||
public class HammerRepair: Interactable
|
||||
{
|
||||
public override void Use(InteractionController 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);
|
||||
NAudio.Play(clip, transform.position);
|
||||
}
|
||||
}
|
3
Assets/Scripts/Interactable/HammerRepair.cs.meta
Normal file
3
Assets/Scripts/Interactable/HammerRepair.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bde7b42f7560494da2171ea528381467
|
||||
timeCreated: 1723989068
|
25
Assets/Scripts/Interactable/HammerableRigidbody.cs
Normal file
25
Assets/Scripts/Interactable/HammerableRigidbody.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Nothke.Interaction;
|
||||
using Nothke.Interaction.Items;
|
||||
using UnityEngine;
|
||||
|
||||
public class HammerableRigidbody: RigidbodyInteractable
|
||||
{
|
||||
public override void Use(InteractionController 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);
|
||||
NAudio.Play(clip, transform.position);
|
||||
}
|
||||
}
|
3
Assets/Scripts/Interactable/HammerableRigidbody.cs.meta
Normal file
3
Assets/Scripts/Interactable/HammerableRigidbody.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3f1ba88558d742b9a6f1c78794058aba
|
||||
timeCreated: 1723987695
|
Reference in New Issue
Block a user