MaterialShadow Error

0 votes
asked Mar 17, 2016 in Issue by anonymous

I'm getting two errors any time I add a button to the scene. They are:

NullReferenceException: Object reference not set to an instance of an object
MaterialUI.MaterialShadow.SetShadows (Int32 shadowOn) (at Assets/MaterialUI/Scripts/Common/Shadows/MaterialShadow.cs:125)
MaterialUI.MaterialShadow.OnPointerEnter (UnityEngine.EventSystems.PointerEventData data) (at Assets/MaterialUI/Scripts/Common/Shadows/MaterialShadow.cs:97)
UnityEngine.EventSystems.ExecuteEvents.Execute (IPointerEnterHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:24)
UnityEngine.EventSystems.ExecuteEvents.Execute[IPointerEnterHandler] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.EventFunction`1 functor) (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/ExecuteEvents.cs:269)
UnityEngine.EventSystems.EventSystem:Update()

and

NullReferenceException: Object reference not set to an instance of an object
MaterialUI.MaterialShadow.SetShadowsInstant () (at Assets/MaterialUI/Scripts/Common/Shadows/MaterialShadow.cs:136)
MaterialUI.MaterialShadow.Update () (at Assets/MaterialUI/Scripts/Common/Shadows/MaterialShadow.cs:67)

I'm using version 1.1.0. Thanks for the help!

1 Answer

0 votes
answered Mar 21, 2016 by admin (31,720 points)
Hello!

Sorry for the time it took to answer...
I don't really know why you're having this issue. How are you adding the button to the scene? By going to GameObject -> MaterialUI -> Button?
Plus, we release 1.1.2 on the Asset Store, can you try with this version?

Have a great day!
commented Mar 22, 2016 by anonymous
I think I may have found the problem - there is a script named "ShadowAnim.cs" but the class inside is named "AnimatedShadow." This appears to prevent the script from being loaded as a component on any object using it.
commented Mar 23, 2016 by admin (31,720 points)
Hey there, Try removing the MaterialUI folder and reimporting the package - that should solve the issue you're having :) ~ Declan.
Welcome to MaterialUI support! Ask us anything :)
...