2024-04-05 13:18:15 +02:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
public class DeveloperNeeds : MonoBehaviour
|
|
|
|
{
|
2024-04-05 14:08:45 +02:00
|
|
|
[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()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
2024-04-05 14:08:45 +02:00
|
|
|
|
|
|
|
public void spawnNeed(string needName)
|
|
|
|
{
|
2024-04-05 14:34:32 +02:00
|
|
|
|
|
|
|
GameObject spawnedNeed = null;
|
|
|
|
|
2024-04-05 14:08:45 +02:00
|
|
|
switch (needName)
|
|
|
|
{
|
|
|
|
case "coffee":
|
2024-04-05 14:34:32 +02:00
|
|
|
spawnedNeed = Instantiate(Needs[0], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
2024-04-05 14:08:45 +02:00
|
|
|
break;
|
|
|
|
case "mate":
|
2024-04-05 14:34:32 +02:00
|
|
|
spawnedNeed = Instantiate(Needs[1], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
2024-04-05 14:08:45 +02:00
|
|
|
break;
|
|
|
|
case "toilet":
|
2024-04-05 14:34:32 +02:00
|
|
|
spawnedNeed = Instantiate(Needs[2], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
2024-04-05 14:08:45 +02:00
|
|
|
break;
|
|
|
|
case "money":
|
2024-04-05 14:34:32 +02:00
|
|
|
spawnedNeed = Instantiate(Needs[3], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
2024-04-05 14:08:45 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2024-04-05 14:34:32 +02:00
|
|
|
|
|
|
|
if (spawnedNeed != null)
|
|
|
|
{
|
|
|
|
spawnedNeed.transform.SetParent(transform, false);
|
|
|
|
}
|
2024-04-05 14:08:45 +02:00
|
|
|
}
|
2024-04-05 13:18:15 +02:00
|
|
|
}
|