Git Product home page Git Product logo

Comments (8)

cr4yz avatar cr4yz commented on August 12, 2024 1

@AngelKyriako The term Unity3d does appear in SharpNav in a few places but afaik it serves no purpose, Unity support seems to have been removed, but it isn't too difficult to get it working in Unity. One option would be to compile SharpNav as is without the Unity reference and write a function to convert between SharpNav.Geometry.Vector3<->UnityEngine's Vector3. The other, more difficult, option is to look at how SharpNav implements Vector3 from various platforms (MonoGame, OpenTK, SharpDX) and implement Unity's Vector3 in a similar fashion.

You may still be missing the System.Threading.Tasks namespace & the Tuple class, but I believe both of these have been created to work with 3.5 you will just need to find them on the web somewhere. It also wouldn't be too difficult to replace SharpNav's use of Tuple & System.Threading.Tasks as they are used in only 1 or 2 files

edit: I'm going to close this thread, maybe open a new issue if you need further support from the dev :)

from sharpnav.

Robmaister avatar Robmaister commented on August 12, 2024

Ah, forgot I was using the new threading stuff.

I'll see what I can do about this, will probably look into extra preprocessors to make it so that this functionality disappears when you're compiling for an older version of .NET

from sharpnav.

cr4yz avatar cr4yz commented on August 12, 2024

Thanks :)

from sharpnav.

cr4yz avatar cr4yz commented on August 12, 2024

Unity's latest release supports compiling with .NET 4.4 so my issue in particular is resolved. I'm not sure if there's another reason to support 3.5, should I go ahead and close the issue?

from sharpnav.

Robmaister avatar Robmaister commented on August 12, 2024

Yes, I saw that! About time! I read that it was just a compiler update and not a full runtime update - I would first check that it doesn't crash/not compile in Unity since tasks are part of the BCL and not the language syntax.

If it works just fine, then feel free to close it out. Otherwise leave it open and I will eventually get around to it. You could also go and manually change my Parallel.For calls to regular for loops and compile it that way for now.

from sharpnav.

AngelKyriako avatar AngelKyriako commented on August 12, 2024

Hello, I would like to use this library within unity client and an asp .net core server.

  1. The STANDALONE variable should be fine for a .net mvc server ?
  2. I tried to set the compilation variable to UNITY3D but the project produces errors as it cannot find Vector3 dependency from UnityEngine.
    Is there any documentation I am missing or further customization is needed to build the library for unity ?

@Chabinka you sure about that ? last time I checked I needed to target 3.5 for a class library that targets unity.

from sharpnav.

Robmaister avatar Robmaister commented on August 12, 2024

@AngelKyriako

  1. yep, standalone should work fine anywhere

  2. Support was removed, as it would complicate things significantly. If it's still in any documentation, then the documentation is outdated. Unity uses it's own naming convention that differs from MonoGame, OpenTK, and SharpDX. The differences between those three are minimal, so basically just swapping out the namespace using the preprocessor would provide support (with the occasional extension method for properties vs methods, etc.). It's pretty hacky, but allows multiple engine support with zero overhead.

Supporting Unity would mean either an abstraction over vectors (probably a bad idea for performance) or a custom C# preprocessor (or utility that modifies IL directly) to change between the various implementations. The abstraction could still exist for Unity, but at that point, why not just use Standalone and convert SharpNav.Geometry.Vector3 to UnityEngine.Vector3?

If you have a good idea for some middle ground or other solution, feel free to open another issue to discuss that.

For reference, one of the main Unity API differences is in casing. Unity uses .x, .y, and .z for components, and the rest use .X, .Y, .Z

from sharpnav.

AngelKyriako avatar AngelKyriako commented on August 12, 2024

@Robmaister using standalone and converting unity's vector3 to the lib's vector3 seems the best option to me as well. However more than this change is required with a first look.

Thanks for the answer. If I find the time and any other idea on how to integrate unity I will let you know.

from sharpnav.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.