Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Energy Bar Toolkit - 2D and 3D Progress Bars

Discussion in 'Assets and Asset Store' started by genail, Mar 30, 2013.

  1. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    That's correct!
     
  2. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Still making garbage like there's no tomorrow :D i'll check out if renderers other than repeated bar are making overhead.
     
    atomicjoe likes this.
  3. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Posting an update:

    There are more incompatibilities than I first expected :/ Currently, I'm trying to bring fonts subsystem to work. It's not a must-have, but I can't remove it either.

    I will keep you posted!
    - Piotr
     
    julianr and Oshigawa like this.
  4. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Seems complicated, bummer. Sad to bug you about that, but 8 megs of trash per minute is a lot, i can't imagine how it is if someone has more then 10 units in the renderer...
     
  5. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Which renderer are you using? I will try to work around it somehow.
     
    Oshigawa likes this.
  6. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Repeated Renderer UGUI.
     
  7. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Thanks!
     
    Oshigawa likes this.
  8. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    No problem.
     
  9. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    Hey @Oshigawa ,
    How did you measure GC allocation? Did you run the scene directly in the editor or did you connect the profiler to the build app?

    I tried both, and while I'm seeing GC allocations in the editor, there are none after doing the build. The reason is that the editor is doing some additional stuff that I don't have control over it.

    Please let me know how it is in your case. If you're still seeing any allocations, is there a chance that you could send me a demo scene?

    All the best,
    Piotr
     
    Oshigawa likes this.
  10. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    In the editor, i'll try testing in the build and let you know.
     
    genail likes this.
  11. Oshigawa

    Oshigawa

    Joined:
    Jan 26, 2016
    Posts:
    362
    Hi Piotr,

    there's no allocations in the build. Sorry for the harassment, i should have checked it before, i wasn't profiling my builds until now. Something new learned, eh.
     
    atomicjoe likes this.
  12. genail

    genail

    Joined:
    Jul 2, 2012
    Posts:
    1,045
    No worries. I'm glad it works!
    Sorry for not noticing that earlier. Not working with Unity daily has its consequences -_-

    Cheers!
    Piotr
     
  13. XCO

    XCO

    Joined:
    Nov 17, 2012
    Posts:
    379
    Hello I got an error can you please help me understand what to do ?

    UNITY 201.4 LTS

    Assets/Energy Bar Toolkit/Scripts/uGUI/EnergyBarSpawnerUGUI.cs(84,33): error CS1525: Unexpected symbol `networkGroup', expecting `.
     
  14. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    After upgrading to Unity 2020.1.0f1 I'm getting the following exception whenever an energybar is active:

    Code (CSharp):
    1. MissingComponentException: There is no 'CanvasRenderer' attached to the "generated_bar" game object, but a script is trying to access it.
    2. You probably need to add a CanvasRenderer to the game object "generated_bar". Or your script needs to check if the component is attached before using it.
    3. UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.Canvas canvas, UnityEngine.Camera eventCamera, UnityEngine.Vector2 pointerPosition, System.Collections.Generic.IList`1[T] foundGraphics, System.Collections.Generic.List`1[T] results) (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/GraphicRaycaster.cs:321)
    4. UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] resultAppendList) (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/GraphicRaycaster.cs:225)
    5. UnityEngine.EventSystems.EventSystem.RaycastAll (UnityEngine.EventSystems.PointerEventData eventData, System.Collections.Generic.List`1[T] raycastResults) (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:255)
    6. UnityEngine.EventSystems.PointerInputModule.GetMousePointerEventData (System.Int32 id) (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/PointerInputModule.cs:277)
    7. UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent (System.Int32 id) (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:541)
    8. UnityEngine.EventSystems.StandaloneInputModule.ProcessMouseEvent () (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:527)
    9. UnityEngine.EventSystems.StandaloneInputModule.Process () (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/InputModules/StandaloneInputModule.cs:282)
    10. UnityEngine.EventSystems.EventSystem.Update () (at C:/Program Files/Unity/Hub/Editor/2020.1.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:376)
    Is this version of Unity not supported?
     
  15. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    I managed to fix the issue by adding a CanvasRenderer component to the generated bars in EnergyBarUGUIBase's CreateChild function.
     
  16. therewillbebrad

    therewillbebrad

    Joined:
    Mar 2, 2018
    Posts:
    151
    Can confirm this is what worked for me in 2020.1

    Code (CSharp):
    1. Here is the updated function CreateChild:
    2.  
    3. protected T CreateChild<T>(string childName, Transform parent) where T : Component {
    4.         var child = CreateChild<T>(parent, "generated_" + childName);
    5.            
    6.         if (!child.gameObject.GetComponent<CanvasRenderer>())
    7.             child.gameObject.AddComponent<CanvasRenderer>();
    8.  
    9.         createdChildren.Add(child.gameObject);
    10.         SetAsLastGenerated(child.transform);
    11.         ApplyDebugMode(child.gameObject, debugMode);
    12.         return child;
    13.     }
    That's the code snippet from snair in the reviews. Manually adding a canvasrenderer will also work.
     
    sandboks and Rusted_Games like this.
  17. TillmaniaLtd

    TillmaniaLtd

    Joined:
    Jan 29, 2013
    Posts:
    65
    Hey,

    Having compile issues after upgrading to Unity 2019.4:

    /Classes/Native/Mad2D.cpp:35233:15: No matching function for call to 'Object_op_Implicit_m8B2A44B4B1406ED346D1AE6D962294FD58D0D534'

    1. Candidate function not viable: no known conversion from 'GUITexture_t1679093D89FD7E758DB296145046F8BB10DB7E51 *' to 'Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *' for 1st argument

     
  18. Deleted User

    Deleted User

    Guest

    @genail it would be great to get a version thats working with 2020.1, also facing the above il2cpp compilation errors.
     
    twitchfactor likes this.
  19. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    I sent an email to the creator about this error, and attached to that email my fix, the culprit is on the MadiTween.cs where there's a bunch of references to deprecated GUIText and GUITexture. I agree this package needs an update.

    For Example: replace all GUITexture and GUIText like so...

    if(target.GetComponent<Image>()){
    target.GetComponent<Image>().color=colors[3];
    }else if(target.GetComponent<Text>()){
    target.GetComponent<Text>().material.color=colors[3];
     
    Last edited: Jan 4, 2021
    Samustai and twitchfactor like this.
  20. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    558
    Is further support for this asset and compatibility with latest versions of Unity to be expected?
     
  21. wolfomat

    wolfomat

    Joined:
    Oct 19, 2014
    Posts:
    24
    usinng energy bar toolkit breaks the build for armv64:

    Exception: C:\Program Files\Unity\Hub\Editor\2019.4.25f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe did not run properly!

    Failed running "C:\Program Files\Unity\Hub\Editor\2019.4.25f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe" --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARM64" --configuration="Release" --outputpath="D:\Projects\Unity\Toilet Manager - A Toilet Paper Clicker Manager\Temp\StagingArea\assets\bin\Data\Native\arm64-v8a\libil2cpp.so" --cachedirectory="D:\Projects\Unity\Toilet Manager - A Toilet Paper Clicker Manager\Assets\..\Library\il2cpp_android_arm64-v8a/il2cpp_cache" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.4.25f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:/Program Files/Unity/Hub/Editor/2019.4.25f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files/Unity/Hub/Editor/2019.4.25f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --profiler-report --map-file-parser="C:/Program Files/Unity/Hub/Editor/2019.4.25f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory="D:/Projects/Unity/Toilet Manager - A Toilet Paper Clicker Manager/Temp/StagingArea/assets/bin/Data/Managed" --generatedcppdir="D:/Projects/Unity/Toilet Manager - A Toilet Paper Clicker Manager/Temp/StagingArea/Il2Cpp/il2cppOutput"

    stdout:
    Building libil2cpp.so with AndroidToolChain
    Output directory: D:\Projects\Unity\Toilet Manager - A Toilet Paper Clicker Manager\Temp\StagingArea\assets\bin\Data\Native\arm64-v8a
    Cache directory: D:\Projects\Unity\Toilet Manager - A Toilet Paper Clicker Manager\Library\il2cpp_android_arm64-v8a\il2cpp_cache
    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: D:\Projects\Unity\Toilet Manager - A Toilet Paper Clicker Manager\Temp\StagingArea\Il2Cpp\il2cppOutput\Mad2D.cpp:34974:15: error: no matching function for call to 'Object_op_Implicit_m8B2A44B4B1406ED346D1AE6D962294FD58D0D534'
    bool L_31 = Object_op_Implicit_m8B2A44B4B1406ED346D1AE6D962294FD58D0D534(L_30, /*hidden argument*/NULL);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    D:\Projects\Unity\Toilet Manager - A Toilet Paper Clicker Manager\Temp\StagingArea\Il2Cpp\il2cppOutput\Mad2D.cpp:14902:41: note: candidate function not viable: no known conversion from 'GUITexture_t1679093D89FD7E758DB296145046F8BB10DB7E51 *' to 'Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *' for 1st argument
    IL2CPP_EXTERN_C IL2CPP_METHOD_ATTR bool Object_op_Implicit_m8B2A44B4B1406ED346D1AE6D962294FD58D0D534


    any ideo on how to fix that?
     
  22. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Hello wolfomat, check my answer above about IL2CPP compilation workaround to see if that fixes yours
     
  23. crafTDev

    crafTDev

    Joined:
    Nov 5, 2008
    Posts:
    1,820
    Hey,

    Can you use this as a loading screen in WebGL instead of the standard Unity Loader?

    Thanks,
    jrDev
     
  24. wolfomat

    wolfomat

    Joined:
    Oct 19, 2014
    Posts:
    24
    hey rusted games, thanks for the replay!

    I'll check this. didn't notice that the sources are available, since its a mad2d.dll file?! or did you decompile for debugging purposes?

    i'll try this as well:
    Can you use this as a loading screen in WebGL instead of the standard Unity Loader?
     
    crafTDev likes this.
  25. wolfomat

    wolfomat

    Joined:
    Oct 19, 2014
    Posts:
    24
    Hey rusted_games,

    sadly i can't compile to the required dll files.could you maybe provide a compiled dll file, please? that would be awesome!!!

    i tried a lot, but i am failing each time which is not sooo nice at the moment.
     
  26. wolfomat

    wolfomat

    Joined:
    Oct 19, 2014
    Posts:
    24
    got it running, after a while.
    extracted all sources, moved the editor ones into assets/editor, adjusted like rusted_games proposed, commented some lines of code and now it's finally working for my use case.

    some assets required to be copied again in place...
     
  27. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Sorry for the late reply, I didn't compile them back, I put the sources on a folder, and created a assemblydefinition for it. It's been a while since I got a reply from the developer of the asset, I'm afraid now, it's going to be abandoned like many others due to unity constantly breaking changes.
     
  28. Phuzz

    Phuzz

    Joined:
    Mar 31, 2014
    Posts:
    48
    Any news about this? Kinda upsetting how things get abandoned and still stay on the Asset Store without any support.

    I used the code snippet from the Review mentioned above and now getting new Errors

    Unity 2021.3.11f1
     
  29. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    Yep, it is abandoned, and I understand creators not willing or having the time to catch up with every Unity version and their broken API. Could you post the errors?, I have not tried it with U2021 yet.
     
  30. Rusted_Games

    Rusted_Games

    Joined:
    Aug 29, 2010
    Posts:
    135
    I wish the developer made the asset free or hosted the sources on Git to let the community maintain it
     
    hopeful and atomicjoe like this.