Fail trying to change obsolete objects

Hi everyone,

I got this errors with a wwise script :

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(236,12): warning CS0618: UnityEditor.Handles.DrawCapFunction' is obsolete: This delegate is obsolete. Use CapFunction instead.’

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(236,46): warning CS0618: UnityEditor.Handles.SphereCap(int, UnityEngine.Vector3, UnityEngine.Quaternion, float)' is obsolete: Use SphereHandleCap instead’

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(237,12): warning CS0618: UnityEditor.Handles.ScaleValueHandle(float, UnityEngine.Vector3, UnityEngine.Quaternion, float, UnityEditor.Handles.DrawCapFunction, float)' is obsolete: DrawCapFunction is obsolete. Use the version with CapFunction instead. Example: Change SphereCap to SphereHandleCap.’

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(351,12): warning CS0618: UnityEditor.Handles.SphereCap(int, UnityEngine.Vector3, UnityEngine.Quaternion, float)' is obsolete: Use SphereHandleCap instead’

so following this link, I tried to replace it, following carefully the replacement names but I’m doing it wrong because I get this :

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(236,18): error CS0103: The name `SphereHandleCap’ does not exist in the current context

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(236,4): error CS0103: The name `CapFunction’ does not exist in the current context

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(237,70): error CS0103: The name `CapFunction’ does not exist in the current context

Assets/Wwise/Editor/WwiseComponents/AkAmbientInspector.cs(351,4): error CS0103: The name `SphereHandleCap’ does not exist in the current context

So I guess there is more than a few names to replace right ?

I’m using unity 5.6 and wwise 2016.2.2

If it’s wwise code, they should fix it, otherwise you will have to always fix it in every update.

I got this error in this line:

Handles.ScaleValueHandle(interactionArc.FromDegree,
            centerPos + fromAngle * interactionArc.Radius / 2,
            objInteraction.rotation, 1, Handles.SphereCap, 1);

Just change the Handles.SphereCap to Handles.SphereHandleCap:

Handles.ScaleValueHandle(interactionArc.FromDegree,
            centerPos + fromAngle * interactionArc.Radius / 2,
            objInteraction.rotation, 1, Handles.SphereHandleCap, 1);

Had the same warning with a custom handler:

Handles.FreeMoveHandle(pos, Quaternion.identity, handleSize, Vector3.one, (controlID, position, rotation, size) => { //... });

Added eventType …no longer obsolete :slight_smile:

Handles.FreeMoveHandle(pos, Quaternion.identity, handleSize, Vector3.one, (controlID, position, rotation, size, eventType) => { //... });