1
0
Fork 0
This commit is contained in:
Unknown 2018-04-21 16:13:59 +02:00
parent 1ef7a24142
commit fc39fd726b
2 changed files with 21 additions and 6 deletions

View file

@ -71,8 +71,8 @@ GameObject:
serializedVersion: 5 serializedVersion: 5
m_Component: m_Component:
- component: {fileID: 4576663487368228} - component: {fileID: 4576663487368228}
- component: {fileID: 61347333512881174}
- component: {fileID: 114777089437464196} - component: {fileID: 114777089437464196}
- component: {fileID: 61347333512881174}
m_Layer: 0 m_Layer: 0
m_Name: UpperDoor m_Name: UpperDoor
m_TagString: Untagged m_TagString: Untagged
@ -282,7 +282,7 @@ BoxCollider2D:
m_Density: 1 m_Density: 1
m_Material: {fileID: 0} m_Material: {fileID: 0}
m_IsTrigger: 0 m_IsTrigger: 0
m_UsedByEffector: 0 m_UsedByEffector: 1
m_UsedByComposite: 0 m_UsedByComposite: 0
m_Offset: {x: -0.63960123, y: -7.9419603} m_Offset: {x: -0.63960123, y: -7.9419603}
m_SpriteTilingProperty: m_SpriteTilingProperty:
@ -396,6 +396,8 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
Width: 0 Width: 0
Height: 0 Height: 0
doorsRootObject: {fileID: 1394898907781064}
objective: {fileID: 0}
--- !u!212 &212881422167649272 --- !u!212 &212881422167649272
SpriteRenderer: SpriteRenderer:
m_ObjectHideFlags: 1 m_ObjectHideFlags: 1

View file

@ -6,11 +6,16 @@ public class Room : MonoBehaviour {
[SerializeField] [SerializeField]
int Width, Height; // Gridsize for Generation int Width, Height; // Gridsize for Generation
List<Door> doors; List<Door> doors;
List<Transform> spawnpoints;
[SerializeField] [SerializeField]
GameObject doorsRootObject; GameObject doorsRootObject;
[SerializeField]
GameObject spawnpointRootObject;
[SerializeField] [SerializeField]
private Objective objective; private Objective objective;
@ -21,10 +26,15 @@ public class Room : MonoBehaviour {
{ {
doors.Add(d); doors.Add(d);
} }
spawnpoints = new List<Transform>();
foreach (Transform t in spawnpointRootObject.GetComponentsInChildren<Transform>())
{
spawnpoints.Add(t);
}
} }
void Lock() public void Lock()
{ {
foreach (Door d in doors) foreach (Door d in doors)
{ {
@ -32,7 +42,7 @@ public class Room : MonoBehaviour {
} }
} }
void Unlock() public void Unlock()
{ {
foreach (Door d in doors) foreach (Door d in doors)
{ {
@ -40,5 +50,8 @@ public class Room : MonoBehaviour {
} }
} }
public List<Transform> GetSpawnpoints()
{
return spawnpoints;
}
} }