use all MapObjects when exporting assets

This commit is contained in:
in0finite 2022-03-07 03:18:26 +01:00
parent 566a2bd6a3
commit b1c9d38e3a
2 changed files with 16 additions and 6 deletions

View file

@ -158,6 +158,16 @@ namespace SanAndreasUnity.Behaviours.World
return $"{inst.ObjectId}_{inst.Position}_{inst.Rotation}";
}
public void InitAll()
{
this.CreateStaticGeometry();
this.InitStaticGeometry();
this.LoadParkedVehicles();
this.CreateEnexes();
this.LoadWater();
this.FinalizeLoad();
}
public void CreateStaticGeometry ()
{

View file

@ -237,13 +237,13 @@ namespace SanAndreasUnity.Editor
EditorUtilityEx.MarkActiveSceneAsDirty();
EditorUtility.DisplayProgressBar("", "Creating static geometry...", 0f);
cell.CreateStaticGeometry();
EditorUtility.DisplayProgressBar("", "Initializing static geometry...", 0f);
cell.InitStaticGeometry();
EditorUtility.DisplayProgressBar("", "Initializing world...", 0f);
cell.InitAll();
objectsToExport = cell.StaticGeometries
.Select(_ => _.Value.transform)
yield return null;
objectsToExport = cell.gameObject.GetFirstLevelChildrenSingleComponent<MapObject>()
.Select(_ => _.transform)
.AppendIf(cell.Water != null, cell.Water.GetTransformOrNull())
.ToArray();
}