Tweaks and fixes
This commit is contained in:
parent
c291109ffb
commit
c8ccda6d37
3 changed files with 10 additions and 4 deletions
|
@ -204,6 +204,7 @@ public class DungeonGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
start.spawnpoints.Add(start.GetCenter());
|
start.spawnpoints.Add(start.GetCenter());
|
||||||
|
end.spawnpoints.Add(start.GetCenter());
|
||||||
|
|
||||||
foreach (Vector2Int v in allDoors) {
|
foreach (Vector2Int v in allDoors) {
|
||||||
foreach (GenRoom r in rooms) {
|
foreach (GenRoom r in rooms) {
|
||||||
|
|
|
@ -28,6 +28,13 @@ public class EntityObjective : Objective {
|
||||||
if ( activated )
|
if ( activated )
|
||||||
return;
|
return;
|
||||||
base.ActivateGoal(ply);
|
base.ActivateGoal(ply);
|
||||||
|
|
||||||
|
List<Transform> spawnPointList = room.GetSpawnpoints();
|
||||||
|
if (spawnPointList.Count == 0) {
|
||||||
|
ReachedGoal();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ( GameObject i in prefabList ) {
|
foreach ( GameObject i in prefabList ) {
|
||||||
Debug.Log("[ROOMS] Spawning Entity...");
|
Debug.Log("[ROOMS] Spawning Entity...");
|
||||||
if(i == null || player == null) {
|
if(i == null || player == null) {
|
||||||
|
@ -35,8 +42,7 @@ public class EntityObjective : Objective {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameObject tempObject = GameObject.Instantiate(i);
|
GameObject tempObject = UnityEngine.Object.Instantiate(i);
|
||||||
List<Transform> spawnPointList = room.GetSpawnpoints();
|
|
||||||
tempObject.transform.position = spawnPointList[Random.Range(0, spawnPointList.Count)].position;
|
tempObject.transform.position = spawnPointList[Random.Range(0, spawnPointList.Count)].position;
|
||||||
tempObject.GetComponent<Enemy>().SetVictim(player.gameObject);
|
tempObject.GetComponent<Enemy>().SetVictim(player.gameObject);
|
||||||
tempObject.GetComponent<Enemy>().SetObjective(this);
|
tempObject.GetComponent<Enemy>().SetObjective(this);
|
||||||
|
|
|
@ -74,9 +74,8 @@ public class PlayerMovement : MonoBehaviour {
|
||||||
brakeTime = maxBrakeTime;
|
brakeTime = maxBrakeTime;
|
||||||
braking = false;
|
braking = false;
|
||||||
} else if (!braking) {
|
} else if (!braking) {
|
||||||
brakeTime -= (Time.time - lastFrame) * 0.1f;
|
//brakeTime -= (Time.time - lastFrame) * 0.1f;
|
||||||
}
|
}
|
||||||
Debug.Log(braking + " " + brakeTime);
|
|
||||||
if (braking) {
|
if (braking) {
|
||||||
brakeTime += Time.time - lastFrame;
|
brakeTime += Time.time - lastFrame;
|
||||||
GameController.instance.GetAudioControl().SfxStop(AudioControl.Sfx.driving);
|
GameController.instance.GetAudioControl().SfxStop(AudioControl.Sfx.driving);
|
||||||
|
|
Loading…
Add table
Reference in a new issue