示例#1
0
	// UI LOGIC ---------------------------------------------------------------------------------------------------

	private void OnEnable()
	{
	    _lineTexture = new Texture2D(1, 2);
	    _lineTexture.wrapMode = TextureWrapMode.Repeat;
	    _lineTexture.SetPixel(0, 0, new Color(1, 1, 1, 0));
	    _lineTexture.SetPixel(0, 1, new Color(1, 1, 0, 1));
	    _lineTexture.Apply();

	    _infoRect = new Rect(10, 10, 500, 220);

	    GUISkin heuSkin = HEU_EditorUI.LoadHEUSkin();
	    _toolsBGStyle = heuSkin.GetStyle("toolsbg");

	    _selectedCurvePoints.Clear();

	    HEU_Curve.Interaction setInteraction = HEU_Curve.PreferredNextInteractionMode;
	    HEU_Curve.PreferredNextInteractionMode = HEU_Curve.Interaction.VIEW;
	    SwitchToMode(setInteraction);

	    // Moves focus to the Scene window, which we need for keyboard input at start
	    if (SceneView.currentDrawingSceneView != null)
	    {
		SceneView.currentDrawingSceneView.Focus();
	    }

	    // Callback will be used to disable this tool and reset state
	    Selection.selectionChanged += SelectionChangedCallback;

	    _showInfo = false;
	    _showInfoRepaint = false;
	}
		// LOGIC ------------------------------------------------------------------------------------------------------


		private void OnEnable()
		{
			// This forces UI cache to be regenerated
			_toolsInfo = null;
			_toolsInfoSerializedObject = null;

			GUISkin heuSkin = HEU_EditorUI.LoadHEUSkin();
			_toolsBGStyle = heuSkin.GetStyle("toolsbg"); 

			// Callback will be used to disable this tool and reset state
			Selection.selectionChanged += SelectionChangedCallback;
		}