Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Vectrosity - Fast and Easy Line Drawing

Discussion in 'Assets and Asset Store' started by Eric5h5, Sep 26, 2014.

  1. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,236
    Sounds like it would be ideal for that. Whatever method you use for creating the chart, just plug those coordinates into a list and Vectrosity will draw it. You can use a "fake" texture-based glow effect, or do a full-screen image effect.

    --Eric
     
  2. ecoSamJoly

    ecoSamJoly

    Joined:
    Aug 6, 2018
    Posts:
    3
    Hi team, I have an error when build with the cloud:

    [Unity] Error: Could not load signature of Vectrosity.VectorLine:SetMask due to: Could not load file or assembly 'UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none>

    Any idea?
     
  3. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,236
    Try using the Vectrosity source rather than the DLL.

    --Eric
     
  4. ecoSamJoly

    ecoSamJoly

    Joined:
    Aug 6, 2018
    Posts:
    3
    Thanks Eric for your quick response! So I removed the DLL, and use the source. But it get this error:

    [Unity] Error: Could not load signature of LineDrawer:get_vectorLine (that is my class) due to: Could not load file or assembly 'Vectrosity, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. assembly:Vectrosity, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:<unknown type> member:(null) signature:<none>

    I am a bit confused...
    BTW, using Unity 2019.3
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,236
    Unfortunately I have no idea, sorry. I don't really know anything about cloud builds, I just remember Unity 2019 not liking the DLL due to UnityEngine.UI.

    --Eric
     
  6. ecoSamJoly

    ecoSamJoly

    Joined:
    Aug 6, 2018
    Posts:
    3
    Thanks again for your quick response!
    FYI, while It makes the debugging of a cloud builds failed log more confusing; it doesn't create the failure itself (I have successful build despite this error).
    I'll let you know if I have more information. Thanks again!!! : )
     
  7. ckannon

    ckannon

    Joined:
    Sep 10, 2013
    Posts:
    4
    Hey guys,

    Having the following problem. I adapted the SelectionBox from the demo from screen overlay to camera overlay and can't get it to position correctly.

    Code (CSharp):
    1.     void Awake () {
    2.         lineColors = new List<Color32>(new Color32[4]);
    3.         selectionLine = new VectorLine("CurrentActionSelection", new List<Vector2>(5), 3.0f, LineType.Continuous) {capLength = 1.5f};
    4.         selectionLine.SetCanvas(GameObject.Find("VectorCanvas").GetComponent<Canvas>());
    5.     }
    6.  
    7.     public void SelectTarget(GameObject target)
    8.     {
    9.         if (target == null) return;
    10.  
    11.         var posW = target.transform.position;
    12.         var node = MapGraph.GetNodeAt(posW);
    13.         var col = node.GetComponent<BoxCollider2D>();
    14.         var bmin = Camera.main.WorldToScreenPoint(col.bounds.min);
    15.         var bmax = Camera.main.WorldToScreenPoint(col.bounds.max);
    16.         var rect = new Rect(new Vector2(bmin.x, bmin.y), new Vector2(bmax.x - bmin.x, bmax.y - bmin.y));
    17.         selectionLine.MakeRect(rect, 0);
    18.         selectionLine.Draw();
    19.         StartCoroutine(CycleColor());
    20.     }
    21.  
    22.  
    My canvas is pre-created at 0,0,0. When draw gets triggered, the CurrentActionSelection gets added to my VectorCanvas... however the RectTransform position seems to be set to some wildly large numbers. If I modify it in the editor and make the values 0,0,0 - the shape appears correctly around the object I've selected.

    Tried a few things but can't seem to modify the RectTransform in code to achieve the same effect.

    Please help!

    Edit: nevermind, I figured it out. In the SetCanvas there is a boolean called WorldPositionStays that needed to be set to false.

    Thanks,
    Chris
     
    Last edited: Apr 15, 2020
  8. maciekfreak

    maciekfreak

    Joined:
    Sep 21, 2015
    Posts:
    22
    Hello

    I have strange behaviour only on Android device when using Vectrosity

    Code (CSharp):
    1. line = new VectorLine("lineDiscrete", points, 6f, LineType.Discrete);
    2. line.Draw3D();
    It is visible on video below:


    What could be the reason for this problem and how can you deal with it?
     
  9. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,236
    Usually a problem on only one specific platform means a Unity bug regarding that platform, or possibly some hardware limitation. As I'm not particularly familiar with Android and haven't seen anything like that before, I'm afraid I can't even guess what the issue could be.

    --Eric
     
  10. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    42
    Hi Eric5h5
    Im using Vectrosity to Draw UI 2D lines, i found an issues :
    Generated lines wwillbe auto created in new Canvas so they will supperposed to my main Canvas, lines are shown on UI windows i want them under UI items.
     
  11. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,236
    You can use SetCanvas to assign lines to a specific canvas.

    --Eric
     
  12. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    42
    Thanks i will try it.
     
  13. Meatloaf4

    Meatloaf4

    Joined:
    Jul 30, 2013
    Posts:
    71
    I had a chance to finally pick up Vectrocity and so far i'm finding a few things quite hard to work with.

    1. In order to add a VectorObject2D it must be an immediate child of it's own canvas. For my use case I was hoping I could add the VectorObject2D line as I normally would with any other canvas component.
    2. When editing point positions in editor it looks like i can't drag the float value of x or y as I normally would with any other float field in Unity. Currently it looks as if i must enter values in manually which is pretty tough.
    3. It doesn't look like undo is not supported out of the box when making changes in the editor to VectorObject2D.

    I have no doubt on the code side this thing works really well, but right now it seems like i'm having a lot of front facing editor issues.

    Btw i'm currently on Unity 2018.4.17f1 and i'm using Odin Inspector (this might be causing some conflicts leading to the issues).

    Lastly I would say the first issue is bigger in terms of wants for me then the second 2.

    Just wanted to throw my feedback up on the forum as I really want to love this asset as I've heard great things.
     
  14. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,236
    Thank you for the feedback. Vectrosity is primarily intended as a coding asset; the editor UI functionality didn't exist at all until version 5, so the feature focus does tend to reflect that.

    --Eric
     
unityunity