Example #1
0
        static void Init()
        {
            // Debug.Log("AutoSnap: Init");

            AutoSnap window = (AutoSnap)EditorWindow.GetWindow(typeof(AutoSnap));

            window.maxSize = new Vector2(200, 125);
            window.Show();
        }
Example #2
0
        public void OnDisable()
        {
            Debug.Log("AutoSnap: OnDisable");

            EditorPrefs.SetBool(doSnapKey, doSnap);
            EditorPrefs.SetBool(doScaleSnapKey, doScaleSnap);
            EditorPrefs.SetBool(doRotateSnapKey, doRotateSnap);
            EditorPrefs.SetFloat(snapValueXKey, snapValueX);
            EditorPrefs.SetFloat(snapValueYKey, snapValueY);
            EditorPrefs.SetFloat(snapValueZKey, snapValueZ);
            EditorPrefs.SetFloat(snapRotateValueKey, snapRotateValue);

            // Remember we're doing the updates
            updateWindow = this;

            // Normally you'd remove the window, however we don't
            // as we want the snapping to continue when this window is closed
            //EditorApplication.update -= Update;
        }