void Awake() { ParallaxSystem ps = World.Active.GetOrCreateSystem <ParallaxSystem>(); ps.SetMovementBounds(topBound, bottomBound); ps.SetSpawnBounds(leftBound, rightBound); foreach (ParallaxLayer layer in layers) { if (layer.prefab != null) { ps.AddLayer(layer.prefab, layer.count, layer.minVelocity, layer.maxVelocity, layer.height); } } }
public ParallaxOverlay() { IoCManager.InjectDependencies(this); _parallax = IoCManager.Resolve <IEntitySystemManager>().GetEntitySystem <ParallaxSystem>(); }