Inheritance: MonoBehaviour
    public void CreateModule(string url, FarmSensor sensor)
    {
        // Instantiate Module prefab
        GameObject module = Instantiate (sensorModulePrefab) as GameObject;
        module.transform.SetParent (sensorBarScrollContent);

        SensorDisplayModule script = module.GetComponent<SensorDisplayModule> ();
        script.mySensor = sensor;
        script.myResource = sensor.myResource;
        script.StartCoroutine ("Initialize", url);
        sensorModules.Add (script);
        sensor.sensingPoints.Add (script);
        // Set module URL
        // Call initialize function
        // Add to list of sensor modules
    }
Ejemplo n.º 2
0
    public IEnumerator CreateSensor(object[] parms)    //string URL, FarmResource resource)
    {
        string       URL      = ((string)parms [0]).Replace(System.Environment.NewLine, "");
        FarmResource resource = (FarmResource)parms [1];

        GameObject sensor     = Instantiate(sensorPrefab) as GameObject;
        FarmSensor farmSensor = sensor.GetComponent <FarmSensor> ();

        sensor.transform.SetParent(transform);

        resource.sensorsList.Add(farmSensor);
        farmSensor.myResource = resource;

        yield return(farmSensor.StartCoroutine("Initialize", URL));

        yield return(null);
    }
Ejemplo n.º 3
0
    public void CreateModule(string url, FarmSensor sensor)
    {
        // Instantiate Module prefab
        GameObject module = Instantiate(sensorModulePrefab) as GameObject;

        module.transform.SetParent(sensorBarScrollContent);

        SensorDisplayModule script = module.GetComponent <SensorDisplayModule> ();

        script.mySensor   = sensor;
        script.myResource = sensor.myResource;
        script.StartCoroutine("Initialize", url);
        sensorModules.Add(script);
        sensor.sensingPoints.Add(script);
        // Set module URL
        // Call initialize function
        // Add to list of sensor modules
    }