Merge remote-tracking branch 'origin/PiegamesDev' into PiegamesDev
This commit is contained in:
commit
a781e41ae6
4 changed files with 15 additions and 9 deletions
|
@ -1409,6 +1409,7 @@ MonoBehaviour:
|
||||||
RockLUR: {fileID: 1938166751346222, guid: 6b83a6a46c57a634fa5085684bad0085, type: 2}
|
RockLUR: {fileID: 1938166751346222, guid: 6b83a6a46c57a634fa5085684bad0085, type: 2}
|
||||||
RockURD: {fileID: 1437035058628240, guid: 30338afac8ce7054fbff8de89db815e8, type: 2}
|
RockURD: {fileID: 1437035058628240, guid: 30338afac8ce7054fbff8de89db815e8, type: 2}
|
||||||
RockLRD: {fileID: 1251219893662246, guid: e37e0c5d4b013304cbcb32b223264452, type: 2}
|
RockLRD: {fileID: 1251219893662246, guid: e37e0c5d4b013304cbcb32b223264452, type: 2}
|
||||||
|
Flag: {fileID: 1971451785855062, guid: ff87b9de73979cd40a9853419833a91f, type: 2}
|
||||||
playerPrefab: {fileID: 1679161327080020, guid: 3d1911457c1e44f53b6b4044334db52f,
|
playerPrefab: {fileID: 1679161327080020, guid: 3d1911457c1e44f53b6b4044334db52f,
|
||||||
type: 2}
|
type: 2}
|
||||||
ui: {fileID: 1379476069}
|
ui: {fileID: 1379476069}
|
||||||
|
|
|
@ -67,9 +67,11 @@ public class GameController : MonoBehaviour {
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject RockLUR;
|
GameObject RockLUR;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject RockURD;
|
GameObject RockURD;
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
GameObject RockLRD;
|
GameObject RockLRD;
|
||||||
|
[SerializeField]
|
||||||
|
GameObject Flag;
|
||||||
|
|
||||||
private Dictionary<GenerationProcessor.ExtendedTileType, GameObject> genPrefabs;
|
private Dictionary<GenerationProcessor.ExtendedTileType, GameObject> genPrefabs;
|
||||||
private Dictionary<Enemy.Enemys, GameObject> enemyPrefabs;
|
private Dictionary<Enemy.Enemys, GameObject> enemyPrefabs;
|
||||||
|
@ -127,8 +129,9 @@ public class GameController : MonoBehaviour {
|
||||||
{ GenerationProcessor.ExtendedTileType.Ground1, Ground1 },
|
{ GenerationProcessor.ExtendedTileType.Ground1, Ground1 },
|
||||||
{ GenerationProcessor.ExtendedTileType.Ground2, Ground2 },
|
{ GenerationProcessor.ExtendedTileType.Ground2, Ground2 },
|
||||||
{ GenerationProcessor.ExtendedTileType.Ground3, Ground3 },
|
{ GenerationProcessor.ExtendedTileType.Ground3, Ground3 },
|
||||||
{ GenerationProcessor.ExtendedTileType.DoorInner, DoorInner },
|
{ GenerationProcessor.ExtendedTileType.DoorInner, DoorInner },
|
||||||
{ GenerationProcessor.ExtendedTileType.DoorOuter, DoorOuter }
|
{ GenerationProcessor.ExtendedTileType.DoorOuter, DoorOuter },
|
||||||
|
{ GenerationProcessor.ExtendedTileType.Flag, Flag }
|
||||||
};
|
};
|
||||||
enemyPrefabs = new Dictionary<Enemy.Enemys, GameObject> {
|
enemyPrefabs = new Dictionary<Enemy.Enemys, GameObject> {
|
||||||
{ Enemy.Enemys.SCORPION, scorpion }
|
{ Enemy.Enemys.SCORPION, scorpion }
|
||||||
|
@ -228,9 +231,10 @@ public class GameController : MonoBehaviour {
|
||||||
finish.SetDoorsRootObject(doorRootf);
|
finish.SetDoorsRootObject(doorRootf);
|
||||||
finish.Reload();
|
finish.Reload();
|
||||||
finish.transform.SetParent(mapRoot.transform);
|
finish.transform.SetParent(mapRoot.transform);
|
||||||
|
gp.CreateGOFromType(finish.GetCenter(), 0, Room.TileType.DOOR, GenerationProcessor.ExtendedTileType.Flag, goFinish);
|
||||||
|
|
||||||
// Other Rooms
|
// Other Rooms
|
||||||
foreach (GenRoom gr in dg.rooms) {
|
foreach (GenRoom gr in dg.rooms) {
|
||||||
GameObject groom = gp.ProcessRoom(gr.tiles);
|
GameObject groom = gp.ProcessRoom(gr.tiles);
|
||||||
List<Transform> ltg = new List<Transform>(groom.GetComponentsInChildren<Transform>());
|
List<Transform> ltg = new List<Transform>(groom.GetComponentsInChildren<Transform>());
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
||||||
|
|
||||||
public class GenerationProcessor {
|
public class GenerationProcessor {
|
||||||
public enum ExtendedTileType {
|
public enum ExtendedTileType {
|
||||||
BorderOuter, BorderInner, BorderSingle, Ground0, Ground1, Ground2, Ground3, DoorInner, DoorOuter, Rock, RockL, RockU, RockR, RockD, RockLU, RockLR, RockLD, RockUR, RockUD, RockRD, RockLURD, RockLUD, RockLUR, RockURD, RockLRD
|
BorderOuter, BorderInner, BorderSingle, Ground0, Ground1, Ground2, Ground3, DoorInner, DoorOuter, Rock, RockL, RockU, RockR, RockD, RockLU, RockLR, RockLD, RockUR, RockUD, RockRD, RockLURD, RockLUD, RockLUR, RockURD, RockLRD, Flag
|
||||||
}
|
}
|
||||||
Dictionary<ExtendedTileType, GameObject> prefabs;
|
Dictionary<ExtendedTileType, GameObject> prefabs;
|
||||||
public GenerationProcessor(Dictionary<ExtendedTileType, GameObject> prefabs) {
|
public GenerationProcessor(Dictionary<ExtendedTileType, GameObject> prefabs) {
|
||||||
|
@ -39,7 +39,7 @@ public class GenerationProcessor {
|
||||||
return root;
|
return root;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GameObject CreateGOFromType(Vector2 v, int rotation, Room.TileType type, ExtendedTileType t, GameObject root) {
|
public GameObject CreateGOFromType(Vector2 v, int rotation, Room.TileType type, ExtendedTileType t, GameObject root) {
|
||||||
GameObject tmp = null;
|
GameObject tmp = null;
|
||||||
if (type != Room.TileType.GROUND)
|
if (type != Room.TileType.GROUND)
|
||||||
CreateGOFromType(v, 0, Room.TileType.GROUND, GetRandomGroundType(), root);
|
CreateGOFromType(v, 0, Room.TileType.GROUND, GetRandomGroundType(), root);
|
||||||
|
|
|
@ -13,7 +13,8 @@ public class FinishObjective : Objective {
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateGoal() {
|
public override void UpdateGoal() {
|
||||||
ReachedGoal();
|
if ((room.GetCenter() - (Vector2)player.transform.position).magnitude < 2)
|
||||||
|
ReachedGoal();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ReachedGoal() {
|
protected override void ReachedGoal() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue