Пример #1
0
        /// <summary>
        /// Retrievs actual value of given <see cref="ShaderProperty{TPropertyType}"/>.
        /// </summary>
        /// <typeparam name="TPropertyType">Type of selected property.</typeparam>
        /// <param name="property">Property which value will be retrieved.</param>
        /// <returns>Current value of given property.</returns>
        public TPropertyType Get <TPropertyType>(ShaderProperty <TPropertyType> property)
        {
            object value = default(TPropertyType);

            API_Get(this.NativeHandle, property.Index, typeof(TPropertyType), out value);
            return((TPropertyType)value);
        }
Пример #2
0
        /// <summary>
        /// Sets value of <see cref="ShaderProperty{TPropertyType}"/> to given value.
        /// </summary>
        /// <typeparam name="TPropertyType">Type of selected property.</typeparam>
        /// <param name="property">To this property new value will be assigned.</param>
        /// <param name="value">This value will be assigned to property.</param>
        public void Set <TPropertyType>(ShaderProperty <TPropertyType> property, TPropertyType value)
        {
            object objValue = value;

            API_Set(this.NativeHandle, property.Index, typeof(TPropertyType), ref objValue);
        }