Esempio n. 1
0
        void SetValue(AudioOption.Types type, bool hasCurve)
        {
            serializedObject.ApplyModifiedProperties();

            var valueType = AudioOption.ToValueType(type, hasCurve);

            dynamicValue.SetType(valueType, isArray);

            if (type == AudioOption.Types.VolumeScale || type == AudioOption.Types.PitchScale)
            {
                dynamicValue.Value = new Vector3(valueProperty.GetValue <float>(), timeProperty.GetValue <float>(), (float)easeProperty.GetValue <TweenUtility.Ease>());
            }
            else if (type == AudioOption.Types.FadeIn || type == AudioOption.Types.FadeOut)
            {
                dynamicValue.Value = new Vector2(valueProperty.GetValue <float>(), (float)easeProperty.GetValue <TweenUtility.Ease>());
            }
            else
            {
                dynamicValue.Value = valueProperty.GetValue();
            }

            dynamicValue.Serialize();
            serializedObject.Update();
        }