Esempio n. 1
0
    void Start()
    {
        //boundary = initShape1();
        boundary = initShapeL();
        BoundingBox bbox = BoundingBox.CreateFromPoints(boundary);

        Debug.Log(bbox.Format());

        designContext = new DesignContext(boundary);


        particleSystem = new SGPlaningParticleSystem(boundary);
        //particleSystem = new SGPlaningParticleSystemAT(boundary);
        //particleSystem = new SGParticleSystem(boundary);
        for (int i = 0; i < 10; i++)
        {
            //ShapeObject so = SOPoint.CreatePoint();
            ShapeObject so       = createBuilding();
            Building    building = so.grammar.building;
            building.SetRefPos(so);
            building.site = designContext;

            designContext.buildings.Add(building);
            particleSystem.AddRand(so);
        }

        SOPoint[] sops = new SOPoint[3];
        sops[0] = SOPoint.CreatePoint(new Vector3(60, 0, -30));
        sops[1] = SOPoint.CreatePoint(new Vector3(-30, 0, 80));
        sops[2] = SOPoint.CreatePoint(new Vector3(320, 0, 200));
        for (int i = 0; i < sops.Length; i++)
        {
            sops[i].sizable = false;
            float r = 20;
            sops[i].Size = new Vector3(r, r, r);
        }
        designContext.attractions.AddRange(sops);
    }
Esempio n. 2
0
 public CreateBuilding(string inName, PlaningMatrix3 matrix = null, SGParticleSystem psys = null) : base(inName, new string[] { })
 {
     this.matrix = matrix;
     this.psys   = psys;
     Debug.Log("assigned matrix=" + matrix);
 }
Esempio n. 3
0
 public void SetParticleSystem(SGParticleSystem ps)
 {
     ps.particles        = this.particleSystem.particles;
     this.particleSystem = ps;
 }