Ejemplo n.º 1
0
 public FXLight(FXLightController light, int priority)
 {
     this.light = light;
     this.priority = priority;
 }
Ejemplo n.º 2
0
    private void Startup()
    {
        fxControl = new LightFXController();

        devices = new List<FXDevice>();
        zones = new List<FXZone>();

        var result = fxControl.LFX_Initialize();
        if (result == LFX_Result.LFX_Success)
        {
            Debug.Log("AlienFX: Initialized.");

            isInit = true;

            const byte MAX_BUFFER = 255;
            uint numDevices;

            fxControl.LFX_GetNumDevices(out numDevices);
            for (uint devIndex = 0; devIndex < numDevices; ++devIndex)
            {
                // get the device type.
                var desc = new StringBuilder(MAX_BUFFER);
                LFX_DeviceType devType;

                fxControl.LFX_GetDeviceDescription(devIndex, desc, MAX_BUFFER, out devType);

                FXDevice dev = new FXDevice(devIndex, desc.ToString(), devType);

                devices.Add(dev);
                
                // get the zones for this device.
                uint numLights;
                fxControl.LFX_GetNumLights(devIndex, out numLights);

                for (uint lightIndex = 0; lightIndex < numLights; ++lightIndex)
                {
                    LFX_Position position;

                    desc = new StringBuilder(MAX_BUFFER);

                    fxControl.LFX_GetLightDescription(devIndex, lightIndex, desc, MAX_BUFFER);
                    fxControl.LFX_GetLightLocation(devIndex, lightIndex, out position);

                    FXLightController light = new FXLightController(lightIndex, desc.ToString(), position);

                    //Debug.Log("Adding: " + light.name);

                    dev.lights.Add(light);
                }
            }

            StartCoroutine("Run");
        }
        else
        {
            Debug.LogError("AlienFX: Failed Init.");
        }
    }