当前位置: 首页>>代码示例>>C#>>正文


C# LightType.ToString方法代码示例

本文整理汇总了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;
        }
开发者ID:senbeiwabaka,项目名称:Computer-Graphics-Project,代码行数:38,代码来源:LightClass.cs

示例2: TransformLightType

 public static string TransformLightType( LightType type )
 {
     if( mLightTypeTransform.ContainsKey( type.ToString())) {
         return mLightTypeTransform[ type.ToString() ];
     }
     return type.ToString();
 }
开发者ID:GooTechnologies,项目名称:CreateUnityExporter,代码行数:7,代码来源:GLexConfig.cs


注:本文中的LightType.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。