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

30 lines
730 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)
{
foreach (var item in objects)
{
Debug.Log(item);
if (item.name == "IceBolt")
{
Instantiate(item, rightHandTransform.position, Quaternion.identity, rightHandTransform);
}
else
{
Instantiate(item, rightHandTransform.position, Quaternion.identity);
Debug.Log(objectName);
}
}
}
}