Search Unity

Unity Reflect Develop: Custom features and UI

Discussion in 'Unity Reflect' started by JordanBerman, Dec 13, 2022.

  1. JordanBerman

    JordanBerman

    Joined:
    Oct 9, 2022
    Posts:
    2
    Hello,

    I will preface by saying I am a beginner to Unity and c#, but I am excited to start using Unity Reflect to develop an application for a Digital Twin. Therefore, my goal is to stream my BIM model into a custom Unity Reflect app that adds functionality to the base application (i.e I want to keep the base application and build one or two more features for my project). I started from the following link and completed the environment setup. So I am using Unity Editor 2020.3.3f1 LTS and Unity Reflect Version 3.1.0-preview.9 - February 02, 2022.

    https://docs.unity3d.com/reflect/Develop/Start_coding_with_Unity_Reflect.html

    I have two main questions to start:

    Q1. How do I edit the existing Unity Reflect Pipeline to add new features?
    Q2. How do I add a button to the UI that opens a custom UI panel? I want the panel to be similar to the Select Tool or Filter Tool (image included).
    __
    For Q1, I was following this thread https://forum.unity.com/threads/reflect-samples.1169372/
    ...but it didn't completely answer my question. It seems like I need to do the following, but please correct me if I am wrong:
    1. Add MyCustomNode.cs and MyCustomNodeSettings.cs to Assets>Scripts>Pipeline folder.
    2. Edit the ViewerPipelineHelper.cs by adding the Nodes, Inputs/Outputs, and Params for MyCustomNode
    3. Create a new Pipeline Asset from Assets > Reflect > Pipeline > Create Viewer Pipeline Asset
    4. "assign it to the ReflectPipeline MonoBehaviour and reapply the required settings in the inspector."
    5. Click Play and the new feature should work as intended!

    If this is correct, the overall process makes sense. But I don't know:
    1. Where to find the ReflectPipeline MonoBehaviour to reassign the new pipeline asset.
    2. What to add for the Inputs/outputs and Params within the ViewerPipelineHelper.cs
    __
    For Q2, I am familiar with accessing components from Game Objects (such as metadata class) and updating UI elements (such as labels or textures) with data from that component... but when it comes to Unity Reflect, I'm really lost...

    I tried to unpack the UI Root prefab and duplicate the existing Filter button from the Left Sidebar and the Filter Options Dialog. I made some small edits to these new elements and then, I remapped the button click event to show the new Filter Options Dialog...but this really didn't work. What is the process for adding more features to the existing UI?
    __

    Thank you very much for any suggestions to move forward!
     

    Attached Files: