Hey guys,
first off, i´m new to that c# stuff so i want to teach myself a bit by makeing a partless plugin.
So i started looking around YT for some tutorials of plugin making but all videos i found are about part plugins
I also searched this forum and found some stuff that helped me a bit
Well i just want to make a window shown up in the flight scene with a title and some labels for the beginning but i can´t get it to work
Here is the code i have so far:
using UnityEngine;
namespace Omg
{
public class Omg : MonoBehaviour
{
private Rect _windowPosition = new Rect();
public override void OnStart(StartState state)
{
if (state != StartState.Editor)
RenderingManager.AddToPostDrawQueue(0, OnDraw);
}
private void OnDraw()
{
if (this.vessel == FlightGlobals.ActiveVessel)
_windowPosition = GUILayout.Window(10, _windowPosition, OnWindow, "I´m the title :D");
}
private void OnWindow(int windowId)
{
GUILayout.BeginHorizontal(GUILayout.Width(250f));
GUILayout.Label("Guess what? I´m the label!");
GUILayout.EndHorizontal();
GUI.DragWindow();
}
}
}
When i press F6 i got an error about the StartState Methode.
I think it´s coz this code is aimed to a part plugin.
What do i need to change to make this tiny code working?
Oh btw. any tutorial about partless plugins is welcome
cheers
Taxi