Author Topic: ngui3.7.0 unity4.3.4 empty project, meet error..  (Read 5018 times)

woshihuo12

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 17
    • View Profile
ngui3.7.0 unity4.3.4 empty project, meet error..
« on: August 19, 2014, 08:36:05 PM »
Assets/NGUI/Scripts/UI/UICamera.cs(442,46): error CS1061: Type `UnityEngine.GameObject' does not contain a definition for `GetComponentInParent' and no extension method `GetComponentInParent' of type `UnityEngine.GameObject' could be found (are you missing a using directive or an assembly reference?)

the newest ngui can't support unity4.3.4?
why?
and how can i know witch new version ngui can support unity4.3.4?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ngui3.7.0 unity4.3.4 empty project, meet error..
« Reply #1 on: August 20, 2014, 03:14:38 PM »
Change that line to  "return NGUITools.FindInParents<UIRoot>(hoveredObject) != null;" and it will compile.

NGUI has been published with unity 4.5 for the last few updates, actually. My main hard drive died a few weeks back and I had to get a replacement. Unity 4.3 died with it.

P.S. You will need to replace GetComponentInParent in a few places in UICamera to get it to compile in 4.3.

chaerf

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Re: ngui3.7.0 unity4.3.4 empty project, meet error..
« Reply #2 on: September 20, 2014, 03:45:43 PM »
what about parent.getComponent<'script'>()????

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: ngui3.7.0 unity4.3.4 empty project, meet error..
« Reply #3 on: September 21, 2014, 09:01:39 AM »
?