public static void RegistBinding(uint instanceId, SkyDream.TerrainPiece obj) { if (!_terrainDic.ContainsKey(instanceId)) { _terrainDic.Add(instanceId, obj); } else { UnityEngine.Debug.LogErrorFormat("mesh {0} already binded", instanceId); } }
private static bool OnMapGenerateSuccess(uint terrain, uint width, Vector4 location) { Debug.LogFormat("OnMapGenerateSuccess {0} {1},exist {2}", terrain, location, UnityCppBindings.GetTerrain(terrain) != null); var terr = UnityCppBindings.GetTerrain(terrain); if (null != terr) { return(false); } else { terr = new TerrainPiece(terrain, (int)width); return(terr.TerrainInitilizer(width, location)); } }
internal void SetNeighbor(TerrainPiece neighbor, TerrainNeighbor position) { switch (position) { case TerrainNeighbor.neighborPositionLeft: _neighborLeft = neighbor; break; case TerrainNeighbor.neighborPositionRight: _neighborRight = neighbor; break; case TerrainNeighbor.neighborPositionBottom: _neighborBottom = neighbor; break; case TerrainNeighbor.neighborPositionTop: _neighborTop = neighbor; break; } }