コード例 #1
0
        public override void EndBoxCheck(bool isOpen, bool isEnabled)
        {
            _SpecularBox.floatValue = TSFunctions.floatBoolean(isOpen);

            if (!isEnabled)
            {
                if (!_SpecularOn.hasMixedValue)
                {
                    foreach (Material mat in _SpecularOn.targets)
                    {
                        TSFunctions.SetKeyword(mat, "_SPECULARHIGHLIGHTS_OFF", !isEnabled);
                        _SpecularOn.floatValue = TSFunctions.floatBoolean(!mat.IsKeywordEnabled("_SPECULARHIGHLIGHTS_OFF"));
                    }
                }
            }

            foreach (Material mat in _workflow.targets)
            {
                SetupWorkflow(mat, (Workflow)_workflow.floatValue);
            }
            foreach (Material mat in _SpMode.targets)
            {
                SetupSpMode(mat, (SpMode)_SpMode.floatValue);
            }
        }
コード例 #2
0
        public void CheckSpecularOptionsSection(bool isOpen, bool isEnabled)
        {
            _SpecularBox.floatValue = TSFunctions.floatBoolean(isOpen);
            foreach (Material mat in _SpecularOn.targets)
            {
                if (!isEnabled)
                {
                    if (!_SpecularOn.hasMixedValue)
                    {
                        TSFunctions.SetKeyword(mat, "_ENABLE_SPECULAR", isEnabled);
                        _SpecularOn.floatValue = TSFunctions.floatBoolean(material.IsKeywordEnabled("_ENABLE_SPECULAR"));
                    }
                }
            }

            foreach (Material mat in _workflow.targets)
            {
                SetupWorkflow(mat, (Workflow)_workflow.floatValue);
            }
            foreach (Material mat in _SpMode.targets)
            {
                SetupSpMode(mat, (SpMode)_SpMode.floatValue);
            }
            foreach (Material mat in _indirectSpecular.targets)
            {
                SetupIndirectSource(mat, (IndirectSpecular)_indirectSpecular.floatValue);
            }
        }
コード例 #3
0
 public override void EndBoxCheck(bool isOpen, bool isEnabled)
 {
     _ToonRampBox.floatValue = TSFunctions.floatBoolean(isOpen);
     if (!isEnabled)
     {
         if (!_RampOn.hasMixedValue)
         {
             _RampOn.floatValue = 0;
         }
     }
 }
コード例 #4
0
 public void CheckRimLightOptionsSection(bool isOpen, bool isEnabled)
 {
     _RimLightBox.floatValue = TSFunctions.floatBoolean(isOpen);
     if (!isEnabled)
     {
         if (!_RimLightOn.hasMixedValue)
         {
             _RimLightOn.floatValue = 0;
         }
     }
 }
コード例 #5
0
 public void CheckBasicSpecularOptionsSection(bool isOpen, bool isEnabled)
 {
     _SpecularBox.floatValue = TSFunctions.floatBoolean(isOpen);
     foreach (Material mat in _SpecularOn.targets)
     {
         if (!isEnabled)
         {
             if (!_SpecularOn.hasMixedValue)
             {
                 TSFunctions.SetKeyword(mat, "_ENABLE_SPECULAR", isEnabled);
                 _SpecularOn.floatValue = TSFunctions.floatBoolean(material.IsKeywordEnabled("_ENABLE_SPECULAR"));
             }
         }
     }
 }
コード例 #6
0
 public void CheckDrawDetailOptionsSection(bool isOpen, bool isEnabled)
 {
     _DetailBox.floatValue = TSFunctions.floatBoolean(isOpen);
     foreach (Material mat in _DetailMapOn.targets)
     {
         TSFunctions.SetKeyword(mat, "_DETAIL_MAP", isEnabled);
     }
     if (!isEnabled)
     {
         if (!_DetailMapOn.hasMixedValue)
         {
             _DetailMapOn.floatValue = 0;
         }
     }
 }
コード例 #7
0
 public override void EndBoxCheck(bool isOpen, bool isEnabled)
 {
     _OutlineBox.floatValue = TSFunctions.floatBoolean(isOpen);
     if (!isEnabled)
     {
         if (!_OutlineOn.hasMixedValue)
         {
             _OutlineOn.floatValue = 0;
             foreach (Material mat in _OutlineOn.targets)
             {
                 ToonyStandardGUI.SetupMaterialWithBlendMode(mat, (ToonyStandardGUI.BlendMode)mat.GetFloat("_Mode"), mat.GetFloat("_OutlineOn") > 0);
             }
         }
     }
 }
コード例 #8
0
 public override void EndBoxCheck(bool isOpen, bool isEnabled)
 {
     _DetailBox.floatValue = TSFunctions.floatBoolean(isOpen);
     foreach (Material mat in _DetailMapOn.targets)
     {
         TSFunctions.SetKeyword(mat, "_DETAIL_MULX2", isEnabled);
     }
     if (!isEnabled)
     {
         if (!_DetailMapOn.hasMixedValue)
         {
             _DetailMapOn.floatValue = 0;
         }
     }
 }
コード例 #9
0
 public void CheckRampOptionsChanges(bool isOpen, bool isEnabled)
 {
     _ToonRampBox.floatValue = TSFunctions.floatBoolean(isOpen);
     if (!isEnabled)
     {
         if (!_RampOn.hasMixedValue)
         {
             _RampOn.floatValue = 0;
         }
         _Ramp.textureValue                   = TSConstants.DefaultRamp;
         _RampOffset.floatValue               = 0f;
         _ShadowIntensity.floatValue          = 0.4f;
         _OcclusionOffset.floatValue          = 0f;
         _OcclusionOffsetIntensity.floatValue = 0f;
         _FakeLight.floatValue                = 0f;
     }
 }
コード例 #10
0
        //Functions to delegate to the rim light section
        #region RimLightOptionsDelegates

        public void DrawRimLightOptionsSection(MaterialEditor materialEditor)
        {
            bool isEmissiveRimEnabled;

            EditorGUILayout.Space();
            TSFunctions.ProperColorBox(ref _RimColor, Styles.rimColor);
            materialEditor.ShaderProperty(_RimIntensity, Styles.rimIntensity);
            materialEditor.ShaderProperty(_RimStrength, Styles.rimStrength);
            materialEditor.ShaderProperty(_RimSharpness, Styles.rimSharpness);
            EditorGUI.BeginChangeCheck();
            isEmissiveRimEnabled = TSFunctions.ProperToggle(ref _EmissiveRim, Styles.emissiveRim);
            if (EditorGUI.EndChangeCheck())
            {
                _EmissiveRim.floatValue = TSFunctions.floatBoolean(isEmissiveRimEnabled);
            }

            EditorGUILayout.Space();
        }
コード例 #11
0
        public override void EndBoxCheck(bool isOpen, bool isEnabled)
        {
            _StencilBox.floatValue = TSFunctions.floatBoolean(isOpen);
            if (!isEnabled)
            {
                if (!_StencilOn.hasMixedValue)
                {
                    _StencilOn.floatValue = 0;

                    _StencilID.floatValue   = 0;
                    _StencilComp.floatValue = 0;
                    _StencilOp.floatValue   = 0;

                    _OutlineStencilID.floatValue   = 0;
                    _OutlineStencilComp.floatValue = 0;
                    _OutlineStencilOp.floatValue   = 0;
                }
            }
        }
コード例 #12
0
        public override void SectionContent(MaterialEditor materialEditor, MaterialProperty[] properties)
        {
            FindProperties(properties);

            bool isEmissiveRimEnabled;

            EditorGUILayout.Space();
            TSFunctions.ProperColorBox(ref _RimColor, Styles.rimColor);
            materialEditor.ShaderProperty(_RimIntensity, Styles.rimIntensity);
            materialEditor.ShaderProperty(_RimStrength, Styles.rimStrength);
            materialEditor.ShaderProperty(_RimSharpness, Styles.rimSharpness);
            EditorGUI.BeginChangeCheck();
            isEmissiveRimEnabled = TSFunctions.ProperToggle(ref _EmissiveRim, Styles.emissiveRim);
            if (EditorGUI.EndChangeCheck())
            {
                _EmissiveRim.floatValue = TSFunctions.floatBoolean(isEmissiveRimEnabled);
            }

            EditorGUILayout.Space();
        }