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

30 lines
730 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)
{
2022-03-24 16:02:34 +00:00
Debug.Log(item);
if (item.name == "IceBolt")
{
Instantiate(item, rightHandTransform.position, Quaternion.identity, rightHandTransform);
}
else
2022-03-07 16:33:30 +00:00
{
Instantiate(item, rightHandTransform.position, Quaternion.identity);
Debug.Log(objectName);
2022-03-07 16:33:30 +00:00
}
}
}
}