Microsoft.Xna.Framework.Graphics.EffectParameter.GetValueSingle C# (CSharp) Метод

GetValueSingle() публичный Метод

public GetValueSingle ( ) : System.Single
Результат System.Single
		public Single GetValueSingle ()
		{
            // TODO: Should this fetch int and bool as a float?
            if (ParameterClass != EffectParameterClass.Scalar || ParameterType != EffectParameterType.Single)
                throw new InvalidCastException();

			return ((float[])Data)[0];
		}

Usage Example

Пример #1
0
 /// <summary>
 /// Gets the value of the parameter as a single.
 /// </summary>
 /// <returns>
 /// The single value
 /// </returns>
 public float GetValueSingle()
 {
     return(_param.GetValueSingle());
 }