Compare commits

...

2 Commits

9 changed files with 30 additions and 17 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -20,22 +20,30 @@ public class DeveloperNeeds : MonoBehaviour
public void spawnNeed(string needName) public void spawnNeed(string needName)
{ {
GameObject spawnedNeed = null;
switch (needName) switch (needName)
{ {
case "coffee": 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; break;
case "mate": 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; break;
case "toilet": 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; break;
case "money": 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; break;
default: default:
break; break;
} }
if (spawnedNeed != null)
{
spawnedNeed.transform.SetParent(transform, false);
}
} }
} }

View File

@ -34,6 +34,7 @@ public class NPC_Behavior : MonoBehaviour
private GameManager _gameManager; private GameManager _gameManager;
private DeveloperNeeds _developerNeeds; private DeveloperNeeds _developerNeeds;
private bool spawned = true;
// Start is called before the first frame update // Start is called before the first frame update
void Start() void Start()
@ -46,9 +47,11 @@ public class NPC_Behavior : MonoBehaviour
void Update() void Update()
{ {
// fire event // 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); File.WriteAllBytes(tempFilePath, audioBytes);
StartCoroutine(LoadWavAudio(tempFilePath)); StartCoroutine(LoadWavAudio(tempFilePath));
SaveAudioFile(base64AudioContent);
} }
IEnumerator LoadWavAudio(string path) IEnumerator LoadWavAudio(string path)