Author Topic: UIRectEditor errors  (Read 2011 times)

Seathus

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
UIRectEditor errors
« on: June 27, 2014, 11:26:40 AM »
Hey guys,

Im having a few problems with the UIRectEditor class and I was hoping someone could help me, the first error is:

"Type Camera does not contain a member 'GetSides' and the best extension method overload 'NGUITools.GetSides(this UnityEngine.Camera, UnityEngine.Transform)' has some invalid arguments"

The second error is "Camera cannot be converted to 'UnityEngine.Camera'"

They both lead to this:

  1. Vector3[] sides = (targetRect != null) ?
  2. targetRect.GetSides(myRect.cachedTransform) :
  3. targetCam.GetSides(myRect.cachedTransform);

specifically this line:

  1. targetCam.GetSides(myRect.cachedTransform);

I appreciate the help!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UIRectEditor errors
« Reply #1 on: June 27, 2014, 02:03:48 PM »
Those extension methods are a part of NGUITools.cs, beginning at the end of the file around line 1400.

The error message "Camera cannot be converted to 'UnityEngine.Camera'" means you have your own class named "Camera" that conflicts with Unity's own Camera class.

Name it something different.