Exemple #1
0
    void Awake()
    {
        GameObject databaseGameObject = Instantiate(DatabasePrefab, transform);

        Database = databaseGameObject.GetComponent <Cognitics.UnityCDB.Database>();
        //Database.GeographicBounds = new Cognitics.CDB.GeographicBounds(new Cognitics.CDB.GeographicCoordinates(45, -124), new Cognitics.CDB.GeographicCoordinates(46, -123));
        Database.Initialize(LosAngelesCDB);
        Database.name = Database.DB.Name;
    }
Exemple #2
0
 void Start()
 {
     vertexSelector = userObject.GetComponent <VertexSelector>();
     feature        = new Feature();
     attribute      = new AttributesTable();
     fpsCDB         = FilePanelCDB.GetComponent <FilePanel_SelectCDB>();
     cdbDatabase    = fpsCDB.GetCDBDatabase();
     userScript     = userObject.GetComponent <User>();
     SaveToNTS();
 }
Exemple #3
0
    protected void Awake()
    {
        if (DatabasePrefab != null)
        {
            var databaseGameObject = Instantiate(DatabasePrefab, transform);
            Database = databaseGameObject.GetComponent <Cognitics.UnityCDB.Database>();
            Database.Initialize(CDBPath);
            Database.name = Database.DB.Name;
        }

        foreach (var shapeType in ShapeTypes)
        {
            if (shapeType.Skip)
            {
                continue;
            }

            if (shapeType.Prefab != null)
            {
                foreach (var path in shapeType.Paths)
                {
                    var shapeInstance = Instantiate(shapeType.Prefab, transform, false).GetComponent <Cognitics.UnityCDB.ShapeBase>();
                    if (shapeInstance != null)
                    {
                        shapeInstance.name             = path;
                        shapeInstance.transform.parent = transform;
                        shapeInstance.Database         = Database;
                        shapeInstance.UserObject       = UserObject;
                        shapeInstance.Path             = path;
                        shapeInstance.Filename         = shapeType.Filename;
                        shapeInstance.gameObject.SetActive(true);
                    }
                    else
                    {
                        Debug.LogErrorFormat("no shape component was found in prefab {0}! cannot instantiate shape instance.", shapeType.Prefab.name);
                    }
                }
            }
        }
    }