Extending Unity UI

Hey Everyone,

I am having some issues with the Unity source on BitBucket. I was able to extend it at home with no issues and have it work in Unity.

The weird thing is when I import it on my work computer (after making no changes to the source) no images show up. I just get spammed with the error from Graphic.cs

MissingMethodException: Method not found: 'UnityEngine.GameObject.GetComponentsInParent'.
UnityEngine.UI.Graphic.get_canvas ()
UnityEngine.UI.Graphic.GetPixelAdjustedRect ()
UnityEngine.UI.Image.GenerateSlicedSprite (System.Collections.Generic.List`1 vbo)
UnityEngine.UI.Image.OnFillVBO (System.Collections.Generic.List`1 vbo)
UnityEngine.UI.Graphic.UpdateGeometry ()
UnityEngine.UI.Graphic.Rebuild (CanvasUpdate update)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate ()
UnityEngine.Canvas:SendWillRenderCanvases()

I am not sure what is causing this problem. (besides for the fact that the method is missing I just don’t know how to fix that)

Things I did.

  1. Downloaded source from bitbucket.
  2. Built with XBuild/msBuild
  3. Put in Data\UnityExtensions\Unity\GUISystem\4.6.0\
  4. Go in game and get spammed with error and no graphics draw.

What I have tried

  1. Building it again (maybe it will work this time)
  2. Deleting the library
  3. Restarting mono and building again.

Info:
Computer: W7
Unity: 4.6.0f3

If anyone has an Idea that would be amazing.

Thank you,

Byron

Here’s some confirmation.
I’m having a similar problem (but have not gotten it to work at all).

I built in VisualStudio 2012.
Create new guid value in the Asseblyinfo.cs file.
Build projects separately - changing guid between builds.
Moved release build dlls into Data\UnityExtensions\Unity\GUISystem.4.6.0\

Get this error repeatedly:

MissingMethodException: Method not found: 'UnityEngine.GameObject.GetComponentsInParent'.
UnityEngine.UI.Graphic.OnEnable ()
UnityEngine.UI.MaskableGraphic.OnEnable ()
UnityEngine.UI.Text.OnEnable ()

From the error, it looks as if we may also have to replace UnityEngine.dll
I tried to do that in the Playback folders, but no improvement.

Restore back to the dlls shipped with the release, everything works fine again.

(Windows 7, Unity 4.6.0f3)

Question:
Should we be changing GUID values and update ivy.xml or
use the existing guid values in ivy.xml when building the new dlls (that seems wrong to me.).

Jeff.

1 Like

I have the same problem! Everything was working fine. Added an event to the source and BANG got this error. Didn’t even touch the graphics part of the source. No clue whats going on here and can’t get it to go away now.

MissingMethodException: Method not found: ‘UnityEngine.GameObject.GetComponentsInParent’.
UnityEngine.UI.Graphic.OnEnable () (at j:/ChuArenaRoot/UnityUI/UnityEngine.UI/UI/Core/Graphic.cs:248)
UnityEngine.UI.MaskableGraphic.OnEnable () (at j:/ChuArenaRoot/UnityUI/UnityEngine.UI/UI/Core/MaskableGraphic.cs:90)

Hi.

Please make sure you are using the same version as the installed unity version. The repository is tagged with the releases (such as 4.6.0f3 / 4.6.1f2) make sure you get the version that matches the version of Unity you have installed. That function was added in 4.6.0p1, so if you only have unity 4.6.0f3 it will not be found :).

I am not going to lie I feel a little dumb for missing that.

Thank you Tim!