hello, do you know how I can draw with my mouse on textures? or other drawing tricks? I speak in from the side of the editor not in the gameScene. Below a sample code:
using UnityEngine;
using UnityEditor;
public class MyWindow : EditorWindow
{
string myString = "Bella zi";
bool groupEnabled;
bool myBool = true;
float myFloat = 1.23f;
Texture2D texty = new Texture2D(150,150);
// Add menu named "My Window" to the Window menu
[MenuItem ("Window/My Window")]
static void Init ()
{
// Get existing open window or if none, make a new one:
MyWindow window = (MyWindow)EditorWindow.GetWindow (typeof (MyWindow));
window.Show ();
}
void OnGUI ()
{
GUILayout.Label ("Base Settings", EditorStyles.boldLabel);
EditorGUILayout.TextArea(myString, GUILayout.Height(200));
//little box with texture to draw <-------
GUILayout.Box(texty,GUILayout.Width(150),GUILayout.Height(150));
groupEnabled = EditorGUILayout.BeginToggleGroup ("Optional Settings", groupEnabled);
myBool = EditorGUILayout.Toggle ("Toggle", myBool);
myFloat = EditorGUILayout.Slider ("Slider", myFloat, -3, 3);
EditorGUILayout.EndToggleGroup ();
}
}
thanks!!