當前位置: 首頁>>代碼示例>>C#>>正文


C# MaterialEditor.RangeProperty方法代碼示例

本文整理匯總了C#中UnityEditor.MaterialEditor.RangeProperty方法的典型用法代碼示例。如果您正苦於以下問題:C# MaterialEditor.RangeProperty方法的具體用法?C# MaterialEditor.RangeProperty怎麽用?C# MaterialEditor.RangeProperty使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEditor.MaterialEditor的用法示例。


在下文中一共展示了MaterialEditor.RangeProperty方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: FlowControl

    private void FlowControl(MaterialEditor target)
    {
        Header("Flow", "http://wiki.next-gen-sprites.com/doku.php?id=shaders:fx:liquid#flow_map");

        if (_hasCurvatureMap)
            target.TextureProperty(_curvatureMap, "Curvature Map", scaleOffset: false);

        target.TextureProperty(_flowMap, "Flow Map", scaleOffset: false);
        target.RangeProperty(_flowIntensity, "Intensity");
        target.RangeProperty(_flowSpeed, "Speed");
        GUILayout.Space(10f);

        ToggleShader(_targetMaterial, "Auto scrolling", ShaderFeature.AutoScrolling.GetString());
        target.RangeProperty(_FlowScrollAuto, "Auto scroll Speed");
        EditorGUI.EndDisabledGroup();

        GUILayout.Space(5f);
        var modeLbl = (_targetMaterial.IsKeywordEnabled(ShaderFeature.AutoScrolling.GetString()) ? "Automatic" : "By Position");
        GUILayout.Box(string.Format("Current Scrolling Mode: {0}", modeLbl));
        GUILayout.Space(5f);

        target.RangeProperty(_FlowScrollX, "Scroll Speed X");
        target.RangeProperty(_FlowScrollY, "Scroll Speed Y");

        
        GUILayout.Space(10f);
        DrawWideBox(1f);
    }
開發者ID:cuongngo90,項目名稱:Unity-SpriteShader,代碼行數:28,代碼來源:NGSMaterialInspectorGeneric.cs

示例2: EmissionControl

    private void EmissionControl(MaterialEditor target, bool noDisablegroup)
    {
        Header("Emission", "http://wiki.next-gen-sprites.com/doku.php?id=shaders:feature:emission");

        target.RangeProperty(_emissionStrength, "Strength");
        if (_hasEmissionTint)
        {
            target.ColorProperty(_emissionTint, "Tint");
            GUILayout.Space(5f);
            target.TextureProperty(_emissionMask, "Mask");
        }


        GUILayout.Space(10f);
        DrawWideBox(1f);
        //Turn off the Disable group?
        if (noDisablegroup) return;
        if (!_shaderCompileKeywords.Contains(ShaderFeature.Emission.GetString()))
            EditorGUI.EndDisabledGroup();
    }
開發者ID:cuongngo90,項目名稱:Unity-SpriteShader,代碼行數:20,代碼來源:NGSMaterialInspectorGeneric.cs

示例3: DissolveControl

    private void DissolveControl(MaterialEditor target)
    {
        Header("Dissolve", "http://wiki.next-gen-sprites.com/doku.php?id=shaders:feature:dissolve");

        target.TextureProperty(_dissolveMap, "Dissolve Pattern", scaleOffset: false);
        target.RangeProperty(_dissolveBlend, "Blend");

        GUILayout.Space(5f);

        target.RangeProperty(_dissolveBorderWidth, "Border Width");
        target.ColorProperty(_dissolveGlowColor, "Border Glow Tint");
        target.RangeProperty(_dissolveGlowStrength, "Border Glow width");

        GUILayout.Space(10f);
        DrawWideBox(1f);
        if (!_shaderCompileKeywords.Contains(ShaderFeature.Dissolve.GetString()))
            EditorGUI.EndDisabledGroup();
    }
開發者ID:cuongngo90,項目名稱:Unity-SpriteShader,代碼行數:18,代碼來源:NGSMaterialInspectorGeneric.cs

示例4: RefractionControl

    private void RefractionControl(MaterialEditor target, bool noDisablegroup)
    {
        Header("Refraction", "http://wiki.next-gen-sprites.com/doku.php?id=shaders:fx:liquid#refraction_map");

        target.TextureProperty(_refractionNormal, "Refraction Map");
        target.RangeProperty(_refractionStrength, "Strength");

        GUILayout.Space(10f);
        DrawWideBox(1f);
    }
開發者ID:cuongngo90,項目名稱:Unity-SpriteShader,代碼行數:10,代碼來源:NGSMaterialInspectorGeneric.cs

示例5: ReflectionControl

    private void ReflectionControl(MaterialEditor target, bool noDisablegroup)
    {
        Header("Reflection", "http://wiki.next-gen-sprites.com/doku.php?id=shaders:feature:reflection#reflection_texture");

        target.TextureProperty(_reflectionScreenMap, "Reflection Texture");
        target.RangeProperty(_reflectionStrength, "Strength");
        target.RangeProperty(_reflectionBlur, "Blur");

        GUILayout.Space(5f);

        target.TextureProperty(_reflectionMask, "Mask", scaleOffset: false);
        target.RangeProperty(_reflectionScrollingX, "X-Axis scrolling");
        target.RangeProperty(_reflectionScrollingY, "Y-Axis scrolling");

        GUILayout.Space(10f);
        DrawWideBox(1f);

        //Turn off the Disable group?
        if (noDisablegroup) return;
        if (!_shaderCompileKeywords.Contains(ShaderFeature.Reflection.GetString()))
            EditorGUI.EndDisabledGroup();
    }
開發者ID:cuongngo90,項目名稱:Unity-SpriteShader,代碼行數:22,代碼來源:NGSMaterialInspectorGeneric.cs

示例6: CurvatureControl

    private void CurvatureControl(MaterialEditor target)
    {
        Header("Curvature", "http://wiki.next-gen-sprites.com/doku.php?id=shaders:fx:lava#curvature");

        target.TextureProperty(_curvatureMap, "Curvature Map");
        target.RangeProperty(_curvatureDepth, "Depth");
        target.ColorProperty(_curvatureHighlight, "Highlight Color");
        target.RangeProperty(_curvatureGloss, "Gloss");

        GUILayout.Space(10f);
        DrawWideBox(1f);
        if (!_shaderCompileKeywords.Contains(ShaderFeature.Curvature.GetString()))
            EditorGUI.EndDisabledGroup();
    }
開發者ID:cuongngo90,項目名稱:Unity-SpriteShader,代碼行數:14,代碼來源:NGSMaterialInspectorGeneric.cs

示例7: MainView

    //This is the Main view with all shader controlls
    private void MainView(MaterialEditor materialEditor)
    {
        GUILayout.Space(5f);

        switch (_setPanel)
        {
            case SettingsMode.Sprites:
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                ButtonOpenUrl(_btnHelp, "http://wiki.next-gen-sprites.com/doku.php?id=shaders:feature:sprite");
                GUILayout.Space(10f);
                EditorGUILayout.EndHorizontal();

                GUILayout.Space(5f);

                materialEditor.TextureProperty(_mainSprite, "Sprite", scaleOffset: false);

                DrawWideBox();
                GUILayout.Space(10f);

                GUILayout.BeginHorizontal();
                materialEditor.ColorProperty(_mainSpriteTint, "Tint");
                if (GUILayout.Button("Reset Tint"))
                {
                    _matTarget.SetColor(ShaderColor.Sprite.GetString(), Color.white);
                }
                GUILayout.EndHorizontal();
                GUILayout.Space(15f);

                ToggleFeature(_matTarget, "Main Layer Scrolling", ShaderFeature.SpriteScrolling);
                GUILayout.Space(5f);
                materialEditor.RangeProperty(_spriteLayer1ScrollingX, "X-Axis");
                materialEditor.RangeProperty(_spriteLayer1ScrollingY, "Y-Axis");
                GUILayout.BeginHorizontal();
                if (GUILayout.Button("Reset Scrolling"))
                {
                    _matTarget.SetFloat(ShaderFloat.SpriteLayer0ScrollingX.GetString(), 0f);
                    _matTarget.SetFloat(ShaderFloat.SpriteLayer0ScrollingY.GetString(), 0f);

                }
                GUILayout.FlexibleSpace();
                GUILayout.EndHorizontal();

                EditorGUI.EndDisabledGroup();


                GUILayout.Space(5f);

                DrawWideBox();
                GUILayout.Space(5f);
                ToggleFeature(_matTarget, "Multi Layer", ShaderFeature.SpriteMultiLayer, disableGroup: false);
                if (_matTarget.IsKeywordEnabled(ShaderFeature.SpriteMultiLayer.GetString()))
                {
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();
                    ButtonOpenUrl(_btnHelp, "http://wiki.next-gen-sprites.com/doku.php?id=shaders:feature:sprite#multi_layer");
                    GUILayout.Space(10f);
                    EditorGUILayout.EndHorizontal();

                    ToggleFeature(_matTarget, "Stencil Mask", ShaderFeature.SpriteStencil, disableGroup: true);
                    materialEditor.TextureProperty(_spriteLayerStencil, "Stencil Mask");
                    EditorGUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.HelpBox("Red: Layer 1# | Green: Layer 2# | Blue: Layer 3#", MessageType.None);
                    GUILayout.FlexibleSpace();
                    EditorGUILayout.EndHorizontal();
                    DrawWideBox();
                    EditorGUI.EndDisabledGroup();

                    GUILayout.Box("Layer 1#", EditorStyles.miniButton);
                    materialEditor.TextureProperty(_spriteLayer2Tex, "Sprite");
                    GUILayout.Space(10f);
                    materialEditor.RangeProperty(_spriteLayer2Opacity, "Opacity");
                    materialEditor.ColorProperty(_spriteLayer2Color, "Tint");
                    materialEditor.RangeProperty(_spriteLayer2ScrollingX, "Scrolling X-Axis");
                    materialEditor.RangeProperty(_spriteLayer2ScrollingY, "Scrolling Y-Axis");

                    GUILayout.Space(10f);
                    GUILayout.BeginHorizontal();
                    GUILayout.FlexibleSpace();
                    if (GUILayout.Button("Reset"))
                    {
                        _matTarget.SetFloat(ShaderFloat.SpriteLayer1Opacity.GetString(), 1f);
                        _matTarget.SetColor(ShaderColor.SpriteLayer1.GetString(), Color.white);
                        _matTarget.SetFloat(ShaderFloat.SpriteLayer1ScrollingX.GetString(), 0f);
                        _matTarget.SetFloat(ShaderFloat.SpriteLayer1ScrollingY.GetString(), 0f);
                    }
                    GUILayout.EndHorizontal();

                    GUILayout.Space(10f);

                    DrawWideBox();
                    GUILayout.Box("Layer 2#", EditorStyles.miniButton);
                    materialEditor.TextureProperty(_spriteLayer3Tex, "Sprite");
                    GUILayout.Space(10f);
                    materialEditor.RangeProperty(_spriteLayer3Opacity, "Opacity");
                    materialEditor.ColorProperty(_spriteLayer3Color, "Tint");
                    materialEditor.RangeProperty(_spriteLayer3ScrollingX, "Scrolling X-Axis");
                    materialEditor.RangeProperty(_spriteLayer3ScrollingY, "Scrolling Y-Axis");
//.........這裏部分代碼省略.........
開發者ID:cuongngo90,項目名稱:Unity-SpriteShader,代碼行數:101,代碼來源:NGSMaterialInspector.cs

示例8: OnGUI

		override public void OnGUI(Rect position, MaterialProperty prop, string label, MaterialEditor editor) {
			bool inactiveFlag = false;
			if (!checkNormalmapsUsage(editor.target as Material, label)) return;
			if (!checkDetailUsage(editor.target as Material, label)) return;
			if (!checkSpecUsage(editor.target as Material, label)) return;
			#if UNITY_5
				if (prop.name=="unity_SpecCube" || prop.name=="unity_SpecCube1") return;
			#endif

			if (checkVisible (editor, label, ref inactiveFlag)) {
				EditorGUI.BeginDisabledGroup(inactiveFlag);
				switch (prop.type) {
					case MaterialProperty.PropType.Range: // float ranges
					{
						editor.RangeProperty(position, prop, label);
						break;
					}
					case MaterialProperty.PropType.Float: // floats
					{
						editor.FloatProperty(position, prop, label);
						break;
					}
					case MaterialProperty.PropType.Color: // colors
					{
						editor.ColorProperty(position, prop, label);
						break;
					}
					case MaterialProperty.PropType.Texture: // textures
					{
						editor.TextureProperty(position, prop, label, texTileOffset);
						break;
					}
					case MaterialProperty.PropType.Vector: // vectors
					{
						position.x+=12;
						position.width-=12;
						editor.VectorProperty(position, prop, label);
						break;
					}
					default:
					{
						GUILayout.Label("Unknown prop type... ("+label+")");
						break;
					}
				}
				EditorGUI.EndDisabledGroup();
			}
		}
開發者ID:andrewstarnes,項目名稱:wwtd2,代碼行數:48,代碼來源:HideByPropDrawer.cs


注:本文中的UnityEditor.MaterialEditor.RangeProperty方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。