forked from cgvr/DeltaVR
can insert printable into 3d printer, 3d printer starts printing
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Printer3DInputHole : MonoBehaviour
|
||||
{
|
||||
public Printer3D printer;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
Debug.Log(other.gameObject.name);
|
||||
Transform parent = other.transform.parent;
|
||||
if (parent != null) {
|
||||
Printable printable = parent.GetComponent<Printable>();
|
||||
if (printable != null)
|
||||
{
|
||||
printer.PrintObject(printable.GetTexture());
|
||||
Destroy(printable.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user