UnityImGUI icon indicating copy to clipboard operation
UnityImGUI copied to clipboard

"Microsoft (R) Visual C# Compiller version 2.9.1.65535 (9d34608e)" after installing UnityImGui package

Open 0xWeebz opened this issue 4 years ago • 31 comments

Hey I'm a little confused on how to actually implement this seeing as there is no documentation. any help is appreciated.

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

Howdy!

After bringing the unity package into your project from the releases, add the ImGuiPluginHook prefab to your scene.

Now, you can write the usual ImGui code (Thanks to ImGUI.NET) in the Update function of one of your scripts.

eg.

using UnityEngine;
using ImGuiNET;
public class MyAwesomeGameScript : MonoBehaviour
{
    public System.Numerics.Vector3 selectedColor;
    public void Update()
    {
        ImGui.Begin("Interesting Game Window");

        if (ImGui.Button("TestButton"))
            Debug.Log("Button Pressed!");

        ImGui.ColorEdit3("Colour Picker", ref selectedColor); 
        ImGui.End();
    }
}

And when running you will get this image

JayPeet avatar Jan 11 '21 22:01 JayPeet

Holy fast reply thank you!

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

image

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

Whats in your project console? Any compile errors?

JayPeet avatar Jan 11 '21 22:01 JayPeet

Uh yeah I'm trying to google that too and its a little difficult image I'm not really too advanced in game development just heard from a friend that unity uses C# and I should try it out

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

Thats a strange issue. Which version of unity are you on?

JayPeet avatar Jan 11 '21 22:01 JayPeet

And is this on windows?

JayPeet avatar Jan 11 '21 22:01 JayPeet

latest 2019.4.17f1 image

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

And correct I am on windows.

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

Hmm, very strange! Thats the exact version that I took that screen shot from a moment ago

It might be something with your visual studio install. I would run the visual studio installer image

Then modify your install image

And then check to make sure you have all the c sharp things installed that you would need (I am not sure which things you would actually need) image

JayPeet avatar Jan 11 '21 22:01 JayPeet

Also, in the project settings in your unity project. In the player tab image Is your Api compatibility level set to this?

JayPeet avatar Jan 11 '21 22:01 JayPeet

Uh I closed unity assuming that it would need to restart after messing with visual studio packages I will relaunch it one second.

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

Sure no rush, Ill be around for a couple hours or so 😄

JayPeet avatar Jan 11 '21 22:01 JayPeet

Unities OnGUI is a lot easier to get running but it doesn't fit my game style, of more modern.

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

OnGUI also ends up allocating each frame if I recall, and is generally bad for performance unless you really mess with some of the internal DLL code relating to it.

ImGUI is really nice, I use it for quick debug menus quite a lot. I wish I had more time to make this perfect to use in all situations, but I just dont have the time :(

JayPeet avatar Jan 11 '21 22:01 JayPeet

Please Excuse my grammar english isn't my first language.

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

I'm creating an online platformer game and I need it for an administration/moderation menu

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

Please Excuse my grammar english isn't my first language.

Don't worry, I understand you fine :)

Sounds like it could be a good game, I wish you luck!

JayPeet avatar Jan 11 '21 22:01 JayPeet

image

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

I dont see the api compatability

0xWeebz avatar Jan 11 '21 22:01 0xWeebz

It would be in the other settings drop down

JayPeet avatar Jan 11 '21 22:01 JayPeet

image

0xWeebz avatar Jan 11 '21 23:01 0xWeebz

I'm so confused

0xWeebz avatar Jan 11 '21 23:01 0xWeebz

Hmm, I have no idea why you might be getting this issue then. I have never seen it before.

It is probably something with your setup. Does it do the same issue in a new project, when you don't have UnityImGUI added?

JayPeet avatar Jan 11 '21 23:01 JayPeet

No.

0xWeebz avatar Jan 11 '21 23:01 0xWeebz

do i need to install ImGUI.net via nuget?

0xWeebz avatar Jan 11 '21 23:01 0xWeebz

No, it should have came with it. Did you check online for that error? It seems like a specific issue

JayPeet avatar Jan 11 '21 23:01 JayPeet

i tried and no results

0xWeebz avatar Jan 11 '21 23:01 0xWeebz

Ima attempt to fix this on my own please leave this issue open i will post any solutions I can come up with for anyone else who has this problem

0xWeebz avatar Jan 11 '21 23:01 0xWeebz

Sure can do, Im going to go to bed shortly. I'll keep an eye out to see if I can figure it out too :)

JayPeet avatar Jan 11 '21 23:01 JayPeet