Author Topic: Getting Warning that a script cannot be loaded for "Control - Colored Slider"  (Read 5407 times)

agamedevr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
Hello,

I am using the prefab "Control - Colored Slider" and I see these warning
The class named 'UISliderColors' is not derived from MonoBehaviour or ScriptableObject!

The associated script can not be loaded. Please fix any compile errors and assign a valid script
The script it is trying to load is UISliderColors

How do I get fix these warnings?

Thank you



ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Sounds like you have your own class called UISliderColors that's conflicting with NGUI's.

agamedevr

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 2
    • View Profile
I have not created any class
I am trying to use then "Colored Scrollbar from the Prefab Toolbar"

See the attached picture with the warningr I get for
UI Slider Colors(Script) in the Unity Inspector

On the Conole I have this warning:
The class named 'UISliderColors' is not derived from MonoBehaviour or ScriptableObject!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Look inside the UISliderColors script. What do you see? It should be:
  1. [AddComponentMenu("NGUI/Examples/Slider Colors")]
  2. public class UISliderColors : MonoBehaviour
...which is what you get when you import NGUI.