DP.DMX.this C# (CSharp) Method

this() public method

Gets of sets the DMX level at specified channel
public this ( int index ) : int
index int
return int
	public int this[int index]
	{
		get
		{
			if (index < 1 || index > N_DMX_CHANNELS)
			{
				throw new UnityException("Channel out fo range: " +index);
			}
			else
			{
				return (int)DMXLevels[index-1];
			}
		}
		set
		{
			if (index < 1 || index > N_DMX_CHANNELS)
			{
				throw new UnityException("Channel out fo range: " +index);
			}
			else
			{
				if (value < 0 || value > 255)
				{
					throw new UnityException("Level out fo range");
				}
				DMXLevels[index-1] = (byte)Mathf.Clamp(value,0,255);
				updateDMX = true;
			}
		}
	}