public void ResetInteractive()
        {
            mat.EnableKeyword(NORMAL_MAP);
            mat.EnableKeyword(METALLIC_GLOSS);

            for (int i = 0; i < originalShaderPropertiesValues.Count; i++)
            {
                ShaderPropertyValue value = originalShaderPropertiesValues[i];
                switch (value.type)
                {
                case ShaderParameterType.Color:
                    mat.SetColor(value.valueName, value.colorValue);
                    break;

                case ShaderParameterType.TexEnv:
                    mat.SetTexture(value.valueName, value.textureValue);
                    break;

                case ShaderParameterType.Vector:
                    mat.SetVector(value.valueName, value.vectorValue);
                    break;

                default:
                    mat.SetFloat(value.valueName, value.floatValue);
                    break;
                }
            }
        }
        public ShaderPropertyValue(ShaderPropertyValue toCopy)
        {
            this.valueName    = string.Copy(toCopy.valueName) ?? throw new ArgumentNullException(nameof(valueName));
            this.stringVal    = string.Copy(toCopy.stringVal) ?? throw new ArgumentNullException(nameof(stringVal));
            this.boolValue    = toCopy.boolValue;
            this.floatValue   = toCopy.floatValue;
            this.vectorValue  = new Vector4(toCopy.vectorValue.x, toCopy.vectorValue.y, toCopy.vectorValue.z, toCopy.vectorValue.w);
            this.colorValue   = new Color(toCopy.colorValue.r, toCopy.colorValue.g, toCopy.colorValue.b, toCopy.colorValue.a);
            this.textureValue = toCopy.textureValue;


            this.type = toCopy.type;
        }
        public void SetUpInit()
        {
            for (int i = 0; i < states.Count; ++i)
            {
                ShaderPropertiesList       currentState = states[i];
                List <ShaderPropertyValue> values       = currentState.values;

                for (int j = 0; j < values.Count; j++)
                {
                    ShaderPropertyValue currentValue = values[j];


                    if (!originalShaderPropertiesValues.Contains(currentValue))
                    {
                        ShaderPropertyValue newValue = new ShaderPropertyValue();
                        newValue.valueName = currentValue.valueName;
                        newValue.type      = currentValue.type;
                        switch (currentValue.type)
                        {
                        case ShaderParameterType.Color:
                            newValue.colorValue = mat.GetColor(currentValue.valueName);
                            break;

                        case ShaderParameterType.TexEnv:
                            newValue.textureValue = mat.GetTexture(currentValue.valueName) as Texture2D;
                            break;

                        case ShaderParameterType.Vector:
                            newValue.vectorValue = mat.GetVector(currentValue.valueName);
                            break;

                        default:
                            newValue.floatValue = mat.GetFloat(currentValue.valueName);
                            break;
                        }

                        originalShaderPropertiesValues.Add(newValue);
                    }
                }
            }
        }
        public void SetStateToPlay(int stateIndex)
        {
            mat.EnableKeyword(NORMAL_MAP);
            mat.EnableKeyword(METALLIC_GLOSS);
            try
            {
                List <ShaderPropertyValue> allValues = states[stateIndex].values;
                for (int i = 0; i < allValues.Count; i++)
                {
                    ShaderPropertyValue value = allValues[i];
                    switch (value.type)
                    {
                    case ShaderParameterType.Color:
                        mat.SetColor(value.valueName, value.colorValue);
                        break;

                    case ShaderParameterType.TexEnv:
                        mat.SetTexture(value.valueName, value.textureValue);
                        break;

                    case ShaderParameterType.Vector:
                        mat.SetVector(value.valueName, value.vectorValue);
                        break;

                    default:
                        mat.SetFloat(value.valueName, value.floatValue);
                        break;
                    }
                }
            }
            catch (IndexOutOfRangeException e)
            {
                Debug.LogWarning("Trying to acess unreachable state index");
                Debug.LogWarning(e.StackTrace);
            }
            catch (ArgumentOutOfRangeException e)
            {
                Debug.LogWarning("Trying to acess unreachable state index");
                Debug.LogWarning(e.StackTrace);
            }
        }