GameVsJam/3d Prototyp/Assets/Scripts/DeveloperNeeds.cs

42 lines
1.3 KiB
C#
Raw Normal View History

2024-04-05 13:18:15 +02:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DeveloperNeeds : MonoBehaviour
{
[SerializeField] List<GameObject> Needs = new List<GameObject>();
2024-04-05 13:18:15 +02:00
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void spawnNeed(string needName)
{
switch (needName)
{
case "coffee":
Instantiate(Needs[0], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
break;
case "mate":
Instantiate(Needs[1], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
break;
case "toilet":
Instantiate(Needs[2], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
break;
case "money":
Instantiate(Needs[3], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
break;
default:
break;
}
}
2024-04-05 13:18:15 +02:00
}