1
0
Fork 0

Tweaks and fixes

This commit is contained in:
Piegames 2018-04-24 00:38:31 +02:00
parent c291109ffb
commit c8ccda6d37
3 changed files with 10 additions and 4 deletions

View file

@ -204,6 +204,7 @@ public class DungeonGenerator {
}
start.spawnpoints.Add(start.GetCenter());
end.spawnpoints.Add(start.GetCenter());
foreach (Vector2Int v in allDoors) {
foreach (GenRoom r in rooms) {

View file

@ -28,6 +28,13 @@ public class EntityObjective : Objective {
if ( activated )
return;
base.ActivateGoal(ply);
List<Transform> spawnPointList = room.GetSpawnpoints();
if (spawnPointList.Count == 0) {
ReachedGoal();
return;
}
foreach ( GameObject i in prefabList ) {
Debug.Log("[ROOMS] Spawning Entity...");
if(i == null || player == null) {
@ -35,8 +42,7 @@ public class EntityObjective : Objective {
return;
}
GameObject tempObject = GameObject.Instantiate(i);
List<Transform> spawnPointList = room.GetSpawnpoints();
GameObject tempObject = UnityEngine.Object.Instantiate(i);
tempObject.transform.position = spawnPointList[Random.Range(0, spawnPointList.Count)].position;
tempObject.GetComponent<Enemy>().SetVictim(player.gameObject);
tempObject.GetComponent<Enemy>().SetObjective(this);

View file

@ -74,9 +74,8 @@ public class PlayerMovement : MonoBehaviour {
brakeTime = maxBrakeTime;
braking = false;
} else if (!braking) {
brakeTime -= (Time.time - lastFrame) * 0.1f;
//brakeTime -= (Time.time - lastFrame) * 0.1f;
}
Debug.Log(braking + " " + brakeTime);
if (braking) {
brakeTime += Time.time - lastFrame;
GameController.instance.GetAudioControl().SfxStop(AudioControl.Sfx.driving);