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

25 lines
551 B
C#
Raw Normal View History

2022-03-07 16:33:30 +00:00
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)
{
2022-03-07 16:33:30 +00:00
foreach (var item in objects)
{
if (item.name == objectName)
{
Instantiate(item, rightHandTransform.position, Quaternion.identity);
Debug.Log(objectName);
2022-03-07 16:33:30 +00:00
}
}
}
}