Skip to content

Commit

Permalink
Merge pull request #35 from ElmarJ/feature/add_existence_controller_t…
Browse files Browse the repository at this point in the history
…o_prefabs

Add existence controller to prefabs
  • Loading branch information
ElmarJ authored May 4, 2022
2 parents 8a483ba + 34d8aca commit 5d5ce7d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Editor/Builders/PrefabsFromGeoJsonBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public void Rebuild()

var featureComponent = go.AddComponent<GeoJsonFeatureInstance>();
featureComponent.Properties = new Dictionary<string, object>(feature.Properties);

var existenceController = go.AddComponent<ExistenceController>();
existenceController.existencePeriodStart = feature.Properties.ContainsKey("exist.period.start") && feature.Properties["exist.period.start"] != null ? (long)feature.Properties["exist.period.start"] : -9999;
existenceController.existencePeriodEnd = feature.Properties.ContainsKey("exist.period.end") && feature.Properties["exist.period.end"] != null ? (long)feature.Properties["exist.period.end"] : 9999;
}
}
}
Expand Down

0 comments on commit 5d5ce7d

Please sign in to comment.