mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2025-02-24 11:17:11 +00:00
fix for not displaying first enex location
This commit is contained in:
parent
362241aace
commit
3367c59b45
2 changed files with 10 additions and 2 deletions
Assets/Scripts
|
@ -83,7 +83,7 @@ namespace SanAndreasUnity.UI {
|
|||
{
|
||||
var obj = GameObject.Find("Player Spawns");
|
||||
if (obj)
|
||||
return obj.GetComponentsInChildren<Transform> ();
|
||||
return obj.transform.GetFirstLevelChildren().ToArray();
|
||||
return new Transform[0];
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ namespace SanAndreasUnity.UI {
|
|||
}
|
||||
|
||||
|
||||
for (int i = 1; i < _spawns.Count; i++)
|
||||
for (int i = 0; i < _spawns.Count; i++)
|
||||
{
|
||||
var spawnLocation = _spawns [i];
|
||||
|
||||
|
|
|
@ -209,6 +209,14 @@ namespace SanAndreasUnity.Utilities
|
|||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<Transform> GetFirstLevelChildren(this Transform tr)
|
||||
{
|
||||
for (int i = 0; i < tr.childCount; i++)
|
||||
{
|
||||
yield return tr.GetChild(i);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetY(this Transform t, float yPos) {
|
||||
Vector3 pos = t.position;
|
||||
pos.y = yPos;
|
||||
|
|
Loading…
Add table
Reference in a new issue