コード例 #1
0
 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);
     }
 }
コード例 #2
0
        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));
            }
        }
コード例 #3
0
ファイル: TerrainPiece.cs プロジェクト: DrYaling/PCGForUnity
        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;
            }
        }