[경고&에러 대응] `UnityEditor.EditorApplication.playmodeStateChanged' is obsolete by pbkim

    void OnEnable()
    {
        if (!IsUnityWritingToPlist())
            RefreshKeys();

        //Make sure we never subscribe twice as OnEnable will be called more often then you think :)
EditorApplication.playmodeStateChanged -= OnPlayModeStateChanged;
EditorApplication.playmodeStateChanged += OnPlayModeStateChanged;
    }

    private void OnPlayModeStateChanged()
    {
        waitTillPlistHasBeenWritten = IsUnityWritingToPlist();

        if (!waitTillPlistHasBeenWritten)
            RefreshKeys();
    }

->

    void OnEnable()
    {
        if (!IsUnityWritingToPlist())
            RefreshKeys();

        //Make sure we never subscribe twice as OnEnable will be called more often then you think :)
       #if UNITY_2017_2_OR_NEWER
        {
            EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
            EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
        }
        #else
        {
            EditorApplication.playmodeStateChanged -= OnPlayModeStateChanged;
            EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
        }
        #endif

    }

    private void OnPlayModeStateChanged(UnityEditor.PlayModeStateChange state)
    {
        waitTillPlistHasBeenWritten = IsUnityWritingToPlist();
        bool  paused = UnityEditor.EditorApplication.isPaused;

        if (!waitTillPlistHasBeenWritten)
            RefreshKeys();
    }


구글 468*60


Linked in

linknow profile