Пример #1
0
        private void populateIsland(IslandPart n)
        {
            if (Random.NextDouble() < 0.1f)
            {
                var tViz = Factory.CreateTrader();
                var t    = tViz.TraderPart;
                t.GivesAmount = 1;
                t.GivesType   = Factory.CogType;

                t.WantsAmount = 5;
                t.WantsType   = Factory.WoodType;

                tViz.PositionComponent.Position = n.Physical.Position;
            }
            ItemPart item;

            while (Random.NextDouble() < 0.1f)
            {
                item = Factory.CreateCog();
                item.PlaceOnIsland(n);
            }

            while (Random.NextDouble() < 0.2f)
            {
                item = Factory.CreateTube();
                item.PlaceOnIsland(n);
            }

            if (Random.NextDouble() < 0.4f)
            {
                var source = Factory.CreateTree();
                source.Physical.Position = n.Physical.Position;
            }
        }
    public MeshHandler(MeshFilter mf, FloatIslandGen gen)
    {
        this.meshFilter   = mf;
        this.meshRenderer = mf.GetComponent <MeshRenderer>();

        this.gen = gen;

        this.botIsland = gen.botIsland;
        this.topIsland = gen.topIsland;

        this.mapChunkSize = gen.mapChunkSize;
        this.a            = gen.a;
        this.b            = gen.b;
        this.seed         = gen.seed;
    }