Heroes_of_Hiis/Assets/Project Files/Scripts/JonasB/SpawnerGestureInteraction.cs

24 lines
534 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpawnerGestureInteraction : MonoBehaviour
{
public List<GameObject> objects;
public Transform rightHandTransform;
public void SpawnObject(string objectName)
{
Debug.Log(objectName);
foreach (var item in objects)
{
if (item.name == objectName)
{
Instantiate(item, rightHandTransform.position, Quaternion.identity);
}
}
}
}