Tested navigation on water and rocks in water.
parent
06b808c10d
commit
c2cce1ae0f
|
@ -138,7 +138,8 @@ public class World : Spatial {
|
||||||
GD.Load<ShaderMaterial>("res://materials/WorldTileTypeMaterial.tres");
|
GD.Load<ShaderMaterial>("res://materials/WorldTileTypeMaterial.tres");
|
||||||
|
|
||||||
Color tileTypeColor = (Color)worldTileTypeShaderMaterial.GetShaderParam(tileTypeName + "Color");
|
Color tileTypeColor = (Color)worldTileTypeShaderMaterial.GetShaderParam(tileTypeName + "Color");
|
||||||
_tileTypeInfos[tileTypeColor.ToRgba32()] = new HexTile3D.TileTypeInfo(tileTypeName, tileTypeColor, tileTypeMask);
|
_tileTypeInfos[tileTypeColor.ToRgba32()] =
|
||||||
|
new HexTile3D.TileTypeInfo(tileTypeName, tileTypeColor, tileTypeMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InitNoiseGenerator() {
|
public void InitNoiseGenerator() {
|
||||||
|
@ -274,6 +275,13 @@ public class World : Spatial {
|
||||||
|
|
||||||
// TODO: MarkCellUnwalkable(cell);
|
// TODO: MarkCellUnwalkable(cell);
|
||||||
// else if (environmentRandom.NextDouble() < 0.01)
|
// else if (environmentRandom.NextDouble() < 0.01)
|
||||||
|
} else if (tileTypeInfo.Name == "Water" || tileTypeInfo.Name == "LightWater" ||
|
||||||
|
tileTypeInfo.Name == "DeepWater") {
|
||||||
|
Spatial rockAsset = SelectAsset(textureCoord, _rockAssets, environmentRandom, 0.01);
|
||||||
|
if (rockAsset != null) {
|
||||||
|
chunk.Entities.AddChild(rockAsset);
|
||||||
|
MarkCellUnwalkable(HexGrid.GetHexAtOffset(offsetCoord));
|
||||||
|
}
|
||||||
// {
|
// {
|
||||||
// var chestAsset = (Chest)_chestScene.Instance();
|
// var chestAsset = (Chest)_chestScene.Instance();
|
||||||
// var assetTransform = Transform.Identity;
|
// var assetTransform = Transform.Identity;
|
||||||
|
@ -488,9 +496,7 @@ public class World : Spatial {
|
||||||
if ((entity.EntityMask ^ tileTypeMask) != 0) {
|
if ((entity.EntityMask ^ tileTypeMask) != 0) {
|
||||||
nextHexCost = 0;
|
nextHexCost = 0;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
GD.Print("Could not find tile type info for color " + tileTypeColor);
|
GD.Print("Could not find tile type info for color " + tileTypeColor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue