コード例 #1
0
ファイル: Sector.cs プロジェクト: Artemijs/MinecraftClone
    public override void InitBlockData()
    {
        int testId = SpeedTests.Instance.StartTest(TestName.SecondPass);

        TerrrainGen.SecondPass(this);
        SpeedTests.Instance.EndTest(TestName.SecondPass, testId);
    }
コード例 #2
0
    // Start is called before the first frame update
    void Awake()
    {
        Chunk._material = _material;
        MeshGenerator.Init();
        TerrrainGen.SetUp();
        Chunk._size  = 5;
        Chunk._uSize = Chunk._size * 1;
        List <int> _nodeChildCount = StaticFunctions._nodeChildCount;
        List <int> _uSizeArray     = StaticFunctions._nodeChildCount;

        Sector._sSize  = 10;
        Sector._suSize = Sector._sSize * Chunk._uSize;

        _nodeChildCount = new List <int>();
        _nodeChildCount.AddRange(new int[] { 5, 10, 2, 2, 2, 2, 2 });
        _uSizeArray = new List <int>();
        _nodeChildCount.Add(5);             //blocks in chunk 5x5x5
        _uSizeArray.Add(5);
        _nodeChildCount.Add(Sector._sSize); //chunks in sector 10x10x10
        _uSizeArray.Add(_uSizeArray[0] * _nodeChildCount[1]);
        _nodeChildCount.Add(2);             //the rest is a 2x2x2

        for (int depth = 1; depth < StaticFunctions._maxDepth; depth++)
        {
            _uSizeArray.Add(_uSizeArray[depth] * _nodeChildCount[depth + 1]);
            _nodeChildCount.Add(2);
        }
        StaticFunctions._nodeChildCount = _nodeChildCount;
        StaticFunctions._uSizeArray     = _uSizeArray;
    }
コード例 #3
0
    public void CreateBlockData(Pair <Vector3Int, Vector3Int> args)
    {
        BlockType bt = TerrrainGen.GetBlockType(args.one + args.two);

        //if (j + _position.y > 2)
        //	bt = BlockType.AIR;
        _parent.Sector.BlockData[args.two.x, args.two.y, args.two.z] = new BlockData(args.one + args.two, bt);
    }
コード例 #4
0
ファイル: Sector.cs プロジェクト: Artemijs/MinecraftClone
 private void CreateBlockData()
 {
     for (int i = 0; i < _suSize; i++)
     {
         for (int j = 0; j < _suSize; j++)
         {
             for (int k = 0; k < _suSize; k++)
             {
                 BlockType bt = TerrrainGen.GetBlockType(_position + new Vector3Int(i, j, k));
                 _blockData[i, j, k] = new BlockData(_position + new Vector3Int(i, j, k), bt);
             }
         }
     }
 }
コード例 #5
0
 void Awake()
 {
     MeshGenerator.Init();
     TerrrainGen.SetUp();
 }
コード例 #6
0
 public override bool Execute()
 {
     TerrrainGen.SecondPass(_parent.Sector);
     return(true);
 }