本文整理汇总了C#中LightType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# LightType.ToString方法的具体用法?C# LightType.ToString怎么用?C# LightType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LightType
的用法示例。
在下文中一共展示了LightType.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LightClass
/// <summary>
/// Constructor or added a new light to the scene
/// </summary>
/// <param name="type">the light type you wish to have or default of point</param>
public LightClass(LightType type = LightType.Point)
{
if (type == LightType.Point)
{
light.Type = type;
light.Diffuse = Color.White;
light.Ambient = Color.White;
light.Specular = Color.White;
light.Position = Vector3.Zero;
light.Range = 100.0f;
}
else if (type == LightType.Directional)
{
light.Type = type;
light.Direction = Vector3.Zero;
light.Ambient = Color.White;
light.Diffuse = Color.White;
light.Specular = Color.White;
light.Range = 100.0f;
}
isLightEnabled = false;
Type = type.ToString();
Position = Vector3.Zero;
Direction = Vector3.Zero;
world = Matrix.Identity;
mesh = Mesh.CreateSphere(DeviceManager.LocalDevice, .1f, 10, 10);
material.Diffuse = Color.White;
material.Ambient = Color.White;
DeviceManager.LocalDevice.Material = material;
}
示例2: TransformLightType
public static string TransformLightType( LightType type )
{
if( mLightTypeTransform.ContainsKey( type.ToString())) {
return mLightTypeTransform[ type.ToString() ];
}
return type.ToString();
}