Beispiel #1
0
    public void CallGenerate(int seed)
    {
        UnityEngine.Random.InitState(seed);

        grid = new Assets.BlockGrid(levelWidth, levelHeight,
                                    new Vector2((destroyableWallBlock.transform.localScale.x * levelWidth),
                                                (destroyableWallBlock.transform.localScale.z * levelHeight)));

        splits = SplitLevels();

        if (buildBlocks)
        {
            BuildBlocks(splits);
            MakePlayerSpawns(splits);
            SpawnLoot(splits);
        }
    }
Beispiel #2
0
    //RCP
    public override void GenerateWorld(RpcArgs args)
    {
        MainThreadManager.Run(() =>
        {
            UnityEngine.Random.InitState(args.GetNext <int>());

            grid = new Assets.BlockGrid(levelWidth, levelHeight,
                                        new Vector2((destroyableWallBlock.transform.localScale.x * levelWidth),
                                                    (destroyableWallBlock.transform.localScale.z * levelHeight)));

            splits = SplitLevels();

            if (buildBlocks)
            {
                BuildBlocks(splits);
                SpawnLoot(splits);
            }
        });
    }