Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyframe-related Deprecation Warnings in Unity 2018 #158

Open
Malkyne opened this issue Oct 21, 2018 · 3 comments
Open

Keyframe-related Deprecation Warnings in Unity 2018 #158

Malkyne opened this issue Oct 21, 2018 · 3 comments

Comments

@Malkyne
Copy link

Malkyne commented Oct 21, 2018

Assets/Plugins/FullSerializer/Converters/Unity/Keyframe_DirectConverter.cs(19,78): warning CS0618: `UnityEngine.Keyframe.tangentMode' is obsolete: `Use AnimationUtility.SetLeftTangentMode, AnimationUtility.SetRightTangentMode, AnimationUtility.GetLeftTangentMode or AnimationUtility.GetRightTangentMode instead.'
Assets/Plugins/FullSerializer/Converters/Unity/Keyframe_DirectConverter.cs(37,28): warning CS0618: `UnityEngine.Keyframe.tangentMode' is obsolete: `Use AnimationUtility.SetLeftTangentMode, AnimationUtility.SetRightTangentMode, AnimationUtility.GetLeftTangentMode or AnimationUtility.GetRightTangentMode instead.'
Assets/Plugins/FullSerializer/Converters/Unity/Keyframe_DirectConverter.cs(39,19): warning CS0618: `UnityEngine.Keyframe.tangentMode' is obsolete: `Use AnimationUtility.SetLeftTangentMode, AnimationUtility.SetRightTangentMode, AnimationUtility.GetLeftTangentMode or AnimationUtility.GetRightTangentMode instead.'
@toddhd
Copy link

toddhd commented Feb 18, 2019

I'm getting the same warning as Malkyne, plus another. This is in Unity 2018.3.6f1 as of this posting. I don't know enough about the source code to make the correct changes myself, still too new to this code.

Assets/Source/Converters/Unity/Keyframe_DirectConverter.cs(19,78): warning CS0618: UnityEngine.Keyframe.tangentMode' is obsolete: Use AnimationUtility.SetLeftTangentMode, AnimationUtility.SetRightTangentMode, AnimationUtility.GetLeftTangentMode or AnimationUtility.GetRightTangentMode instead.'

Assets/Source/Aot/Editor/fsAotConfigurationEditor.cs(15,22): warning CS0618: UnityEditor.EditorApplication.playmodeStateChanged' is obsolete: Use EditorApplication.playModeStateChanged and/or EditorApplication.pauseStateChanged'

@linadk
Copy link

linadk commented Mar 7, 2019

I wanted to clear the warnings in the game I'm working on and fixed them by just updating the properties that needed to be serialized for key frames. Below are the DoSerialize/DoDeserialize methods I used :

        protected override fsResult DoSerialize(Keyframe model, Dictionary<string, fsData> serialized) {
            var result = fsResult.Success;

            result += SerializeMember(serialized, null, "time", model.time);
            result += SerializeMember(serialized, null, "value", model.value);
            result += SerializeMember(serialized, null, "inTangent", model.inTangent);
            result += SerializeMember(serialized, null, "outTangent", model.outTangent);
            result += SerializeMember(serialized, null, "outWeight", model.outWeight);
            result += SerializeMember(serialized, null, "inWeight", model.inWeight);
            result += SerializeMember(serialized, null, "weighedMode", model.weightedMode);

            return result;
        }

        protected override fsResult DoDeserialize(Dictionary<string, fsData> data, ref Keyframe model) {
            var result = fsResult.Success;

            var t0 = model.time;
            result += DeserializeMember(data, null, "time", out t0);
            model.time = t0;

            var t1 = model.value;
            result += DeserializeMember(data, null, "value", out t1);
            model.value = t1;

            var t2 = model.inTangent;
            result += DeserializeMember(data, null, "inTangent", out t2);
            model.inTangent = t2;

            var t3 = model.outTangent;
            result += DeserializeMember(data, null, "outTangent", out t3);
            model.outTangent = t3;

            var t4 = model.outWeight;
            result += DeserializeMember(data, null, "outWeight", out t4);
            model.outWeight = t4;

            var t5 = model.inWeight;
            result += DeserializeMember(data, null, "inWeight", out t5);
            model.inWeight = t5;

            var t6 = model.weightedMode;
            result += DeserializeMember(data, null, "weightedMode", out t6);
            model.weightedMode = t6;

            return result;
        }

@AndrewMSHowe
Copy link

        result += SerializeMember(serialized, null, "weighedMode", model.weightedMode);

You had a typo in the quotes there. I'm getting this too, so thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants