Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

[Released] Wire Builder - easy to use wire creation

Discussion in 'Assets and Asset Store' started by StaggartCreations, Sep 12, 2019.

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855



    An editor tool to create suspended electricity or telephone wires. Built around an intuitive "click & drag" scene-view editor.

    Connectors can be added to GameObjects (eg. utility poles) to form a group. In turn, wires can be connected between connectors.

    Features:
    • Preset-based wire type settings
    • Per-wire adjustable sagging
    • Adjustable wire resolution per meter
    • LineRenderer or MeshRenderer wire generation
    • Animated wire shader (Standard/URP)
    • Compatible with 2D view
    Vegetation Studio tree and object removal underneath wires

    Notes:
    • Wires have a centered pivot so will work with World Streamer or other grid systems
    • Tag and Layer can be set for generated wires
    • Includes Amplify Shader Editor and URP Shader Graph functions for the shader animation effect.

    Limitations:
    • Wires have no collision or physics interaction
    • No editing cannot be done at runtime, this is an editor-only tool

     
    Last edited: Nov 2, 2019
    one_one likes this.
  2. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    501
    That's pretty cool! Is runtime support planned at some point?
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855
    Thanks! I don't have any intention to add this, as the scope is limited to an editor tool ;)
     
  4. one_one

    one_one

    Joined:
    May 20, 2013
    Posts:
    501
    Aw, that's too bad. Is it making extensive use of some unity editor API then?
     
  5. igor250697

    igor250697

    Joined:
    Oct 5, 2018
    Posts:
    3
    Hi, why I can’t buy your product in Asset Store? Found 404
     
  6. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855
    Thank you for your interest, but its still pending review. This typically takes 4 weeks, so puts it somewhere halfway October ;)
     
  7. igor250697

    igor250697

    Joined:
    Oct 5, 2018
    Posts:
    3
    and for what price will you sell?
     
  8. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855
    This is also noted in the first post ;) It is currently set at $15.
     
    Mark_01 likes this.
  9. igor250697

    igor250697

    Joined:
    Oct 5, 2018
    Posts:
    3
    Is it possible with this tool to draw wires in real time directly in the game. Or just on stage unity
     
  10. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855
    The editor side calls on several functions in the static WireManager class, which is a non-editor class. This was done so a runtime API could still be possible, the group, connector and wire components are MonoBehaviours in any event.

    I've added code comments to all the static functions. Which allow you to create/update/destroy group, connectors and wire objects. This includes generating a wire between two connectors. So runtime wire creation should be possible using this.

    All the functionality as seen in the GIFS, for the dragging interaction is still editor-only, simply because it's written for the scene view. Anyone looking to have such interaction in-game would have to recreate this ;)
     
    Mark_01 likes this.
  11. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855
  12. kilik128

    kilik128

    Joined:
    Jul 15, 2013
    Posts:
    875
    wow result look amazing
     
  13. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    215
    Hallo, is it possible somehow to have more options regarding the sagging? Trying to drag the lines up and down in the editor is somehow very limited, because as soon as the cursor hits the border I can't make the sagging more extreme anymore.
     
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855
    Thanks for the feedback, the controls for the sagging is something I couldn't get quite right, so the reach is limited.

    What I can do is exposed the "sagging amount" parameter on the Wire component. This way it can be set there, with whatever value desired. I've just submitted an update which includes this, should be available within a few days.
     
    Last edited: Nov 2, 2019
    ratking likes this.
  15. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    215
    Thank you!

    I'd have some more feedback if you don't mind:
    - Pressing Ctrl+Z after changing the sagging amount via the gizmo doesn't change it back.
    - It should be possible to "clean up" a connector if the user (i.e. me) accidentally deleted a wire via the delete key. I had some really hard to track bugs because apparently there wasn't any hint anywhere that told me that the connector had faulty (missing) wires.
    - Is there some documentation on how to create wires at runtime via code? Is this possible at all? Would be great for procedurally created levels.

    Kind regards,
    ratking
     
  16. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    855
    1. This is true, when an Undo is performed, the value is restored, but the wire isn't (immediately) regenerated afterwards. There is apparently a way to detect this, so I can probably make this work.
    2. Whenever the wire editor is fired up, all the components are validated and missing references are removed. I assume if you're deleting a wire object outside of the editor, this is desired behavior.
    3. The WireManager class has several functions for creating and managing wires. As side from function comments, this is undocumented and unadvertised because run time generation hasn't been tested. But the editor calls on many of these functions as well.
     
  17. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    215
    Thanks for the reply. I didn't know that I had to fire up the wire editor again to remove the missing references, good to know. And I will have a deeper look at the WireManager class.

    Another thing I noticed is that my wires had a very noticeable break in the middle (mostly noticeable in motion, when having a bit of a stronger wind). In order to fix this I changed the generation of the gradient keys in the method NewWindData() in WireGenerator.cs to this:

    Code (CSharp):
    1.             GradientColorKey[] colorKeys = new GradientColorKey[2];
    2.             colorKeys[0] = new GradientColorKey(color, 0f);
    3.             colorKeys[1] = new GradientColorKey(color, 1f);
    4.             GradientAlphaKey[] alphaKeys = new GradientAlphaKey[8];
    5.             for (int i = 0; i < 8; ++i) {
    6.                 var time = i / (float)(8 - 1);
    7.                 alphaKeys[i] = new GradientAlphaKey(Mathf.Sin(time * Mathf.PI), time);
    8.             }
    9.  
    10.             g.SetKeys(colorKeys, alphaKeys);
    This way the linear interpolation isn't so striking anymore, maybe you want to adopt this. (It's still kinda visible though, maybe an AnimationCurve would be a better idea anyway.)
     
  18. osss

    osss

    Joined:
    Jan 20, 2014
    Posts:
    21
    HDRP is actually compatible, just recreate the HDRP shadergraph and connect nodes by refer URP shadergraph.