Win with the flag
(TODO for the flag)
This commit is contained in:
parent
db72c6a707
commit
5717dd259b
4 changed files with 15 additions and 9 deletions
|
@ -1409,6 +1409,7 @@ MonoBehaviour:
|
|||
RockLUR: {fileID: 1938166751346222, guid: 6b83a6a46c57a634fa5085684bad0085, type: 2}
|
||||
RockURD: {fileID: 1437035058628240, guid: 30338afac8ce7054fbff8de89db815e8, type: 2}
|
||||
RockLRD: {fileID: 1251219893662246, guid: e37e0c5d4b013304cbcb32b223264452, type: 2}
|
||||
Flag: {fileID: 1971451785855062, guid: ff87b9de73979cd40a9853419833a91f, type: 2}
|
||||
playerPrefab: {fileID: 1679161327080020, guid: 3d1911457c1e44f53b6b4044334db52f,
|
||||
type: 2}
|
||||
ui: {fileID: 1379476069}
|
||||
|
|
|
@ -67,9 +67,11 @@ public class GameController : MonoBehaviour {
|
|||
[SerializeField]
|
||||
GameObject RockLUR;
|
||||
[SerializeField]
|
||||
GameObject RockURD;
|
||||
GameObject RockURD;
|
||||
[SerializeField]
|
||||
GameObject RockLRD;
|
||||
GameObject RockLRD;
|
||||
[SerializeField]
|
||||
GameObject Flag;
|
||||
|
||||
private Dictionary<GenerationProcessor.ExtendedTileType, GameObject> genPrefabs;
|
||||
private Dictionary<Enemy.Enemys, GameObject> enemyPrefabs;
|
||||
|
@ -127,8 +129,9 @@ public class GameController : MonoBehaviour {
|
|||
{ GenerationProcessor.ExtendedTileType.Ground1, Ground1 },
|
||||
{ GenerationProcessor.ExtendedTileType.Ground2, Ground2 },
|
||||
{ GenerationProcessor.ExtendedTileType.Ground3, Ground3 },
|
||||
{ GenerationProcessor.ExtendedTileType.DoorInner, DoorInner },
|
||||
{ GenerationProcessor.ExtendedTileType.DoorOuter, DoorOuter }
|
||||
{ GenerationProcessor.ExtendedTileType.DoorInner, DoorInner },
|
||||
{ GenerationProcessor.ExtendedTileType.DoorOuter, DoorOuter },
|
||||
{ GenerationProcessor.ExtendedTileType.Flag, Flag }
|
||||
};
|
||||
enemyPrefabs = new Dictionary<Enemy.Enemys, GameObject> {
|
||||
{ Enemy.Enemys.SCORPION, scorpion }
|
||||
|
@ -228,9 +231,10 @@ public class GameController : MonoBehaviour {
|
|||
finish.SetDoorsRootObject(doorRootf);
|
||||
finish.Reload();
|
||||
finish.transform.SetParent(mapRoot.transform);
|
||||
gp.CreateGOFromType(finish.GetCenter(), 0, Room.TileType.DOOR, GenerationProcessor.ExtendedTileType.Flag, goFinish);
|
||||
|
||||
// Other Rooms
|
||||
foreach (GenRoom gr in dg.rooms) {
|
||||
// Other Rooms
|
||||
foreach (GenRoom gr in dg.rooms) {
|
||||
GameObject groom = gp.ProcessRoom(gr.tiles);
|
||||
List<Transform> ltg = new List<Transform>(groom.GetComponentsInChildren<Transform>());
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ using UnityEngine;
|
|||
|
||||
public class GenerationProcessor {
|
||||
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;
|
||||
public GenerationProcessor(Dictionary<ExtendedTileType, GameObject> prefabs) {
|
||||
|
@ -39,7 +39,7 @@ public class GenerationProcessor {
|
|||
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;
|
||||
if (type != Room.TileType.GROUND)
|
||||
CreateGOFromType(v, 0, Room.TileType.GROUND, GetRandomGroundType(), root);
|
||||
|
|
|
@ -13,7 +13,8 @@ public class FinishObjective : Objective {
|
|||
}
|
||||
|
||||
public override void UpdateGoal() {
|
||||
ReachedGoal();
|
||||
if ((room.GetCenter() - (Vector2)player.transform.position).magnitude < 2)
|
||||
ReachedGoal();
|
||||
}
|
||||
|
||||
protected override void ReachedGoal() {
|
||||
|
|
Loading…
Add table
Reference in a new issue