jetzt richtig

This commit is contained in:
klappstuhl24 2024-04-05 14:34:32 +02:00
parent e7d5add835
commit 39034193c1
9 changed files with 30 additions and 17 deletions

View File

@ -29,8 +29,8 @@ Transform:
m_GameObject: {fileID: 2907046783514947559}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 16.851439, y: 4.76935, z: -2.999632}
m_LocalScale: {x: 0.5, y: 0.05, z: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.6, y: 0.05, z: 0.6}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}

View File

@ -29,8 +29,8 @@ Transform:
m_GameObject: {fileID: 3355435593704932208}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 16.851439, y: 4.76935, z: -2.999632}
m_LocalScale: {x: 0.5, y: 0.05, z: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.6, y: 0.05, z: 0.6}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}

View File

@ -29,8 +29,8 @@ Transform:
m_GameObject: {fileID: 2405502523364773131}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 16.851439, y: 4.76935, z: -2.999632}
m_LocalScale: {x: 0.5, y: 0.05, z: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.6, y: 0.05, z: 0.6}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}

View File

@ -251,7 +251,7 @@ MonoBehaviour:
gender: FEMALE
speakingSpeed: 1.1
playSound: 0
generate: 1
generate: 0
--- !u!114 &913419294231391695
MonoBehaviour:
m_ObjectHideFlags: 0
@ -270,7 +270,6 @@ MonoBehaviour:
_baseDevelopementPower: 100
_developementPower: 100
eventRate: 1
_gameManager: {fileID: 0}
--- !u!114 &5010841683893516359
MonoBehaviour:
m_ObjectHideFlags: 0

View File

@ -29,8 +29,8 @@ Transform:
m_GameObject: {fileID: 7697340910557049827}
serializedVersion: 2
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: 16.851439, y: 4.76935, z: -2.999632}
m_LocalScale: {x: 0.5, y: 0.05, z: 0.5}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.6, y: 0.05, z: 0.6}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}

View File

@ -10069,6 +10069,10 @@ PrefabInstance:
propertyPath: m_Name
value: NPC
objectReference: {fileID: 0}
- target: {fileID: 6061794821799343082, guid: 8c373fc5dab15cb479b5aa211e1fee34, type: 3}
propertyPath: generate
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8838918674701777989, guid: 8c373fc5dab15cb479b5aa211e1fee34, type: 3}
propertyPath: m_LocalPosition.x
value: 15.64

View File

@ -20,22 +20,30 @@ public class DeveloperNeeds : MonoBehaviour
public void spawnNeed(string needName)
{
GameObject spawnedNeed = null;
switch (needName)
{
case "coffee":
Instantiate(Needs[0], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
spawnedNeed = Instantiate(Needs[0], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
break;
case "mate":
Instantiate(Needs[1], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
spawnedNeed = Instantiate(Needs[1], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
break;
case "toilet":
Instantiate(Needs[2], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
spawnedNeed = Instantiate(Needs[2], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
break;
case "money":
Instantiate(Needs[3], new Vector3(transform.position.x, transform.position.y + 1.0f, transform.position.z), Quaternion.identity);
spawnedNeed = Instantiate(Needs[3], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
break;
default:
break;
}
if (spawnedNeed != null)
{
spawnedNeed.transform.SetParent(transform, false);
}
}
}

View File

@ -34,6 +34,7 @@ public class NPC_Behavior : MonoBehaviour
private GameManager _gameManager;
private DeveloperNeeds _developerNeeds;
private bool spawned = true;
// Start is called before the first frame update
void Start()
@ -46,9 +47,11 @@ public class NPC_Behavior : MonoBehaviour
void Update()
{
// fire event
if (UnityEngine.Random.Range(0, 60) == 0)
if (spawned)
{
Debug.Log("TEST");
spawned = false;
List<string> needs = new List<string>() { "coffee", "mate", "toilet", "money" };
_developerNeeds.spawnNeed(needs[UnityEngine.Random.Range(0, 3)]);
}
}

View File

@ -220,7 +220,6 @@ public class Text2Speech : MonoBehaviour
File.WriteAllBytes(tempFilePath, audioBytes);
StartCoroutine(LoadWavAudio(tempFilePath));
SaveAudioFile(base64AudioContent);
}
IEnumerator LoadWavAudio(string path)