Comments (8)
@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.
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.
Thanks :)
from sharpnav.
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.
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.
Hello, I would like to use this library within unity client and an asp .net core server.
- The STANDALONE variable should be fine for a .net mvc server ?
- 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.
-
yep, standalone should work fine anywhere
-
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.
@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)
- Agents do not move when requested target is on the same polygon HOT 4
- Using SharpNav.SharpDX in conjunction with SharpDX 3.0.1 HOT 4
- FixupCorridor IndexOutOfRangeException HOT 11
- FindRandomPointAroundCircle IndexOutOfRangeException HOT 2
- No nearby polys InvalidOperationException
- .Obj exported from Unity3D causes System.IndexOutOfRangeException HOT 9
- OpenGL error on Example HOT 10
- .net standard version HOT 2
- ERROR HOT 1
- How to import NavMesh from Unity? HOT 1
- How are SharpNav dealing with Licenses? HOT 3
- CalcSlabEndPoints - Struct by reference needed HOT 1
- Dynamic Obstacle
- Is this library appropriate for my usage? HOT 3
- Mesh generation time. Testing on big meshes. HOT 2
- The "filter" in InitSlicedFindPath
- TiledNavMesh not lining up HOT 2
- Exception: The provided PolyMesh has no vertices. HOT 1
- MergeCorridorStartMoved does not resize the path HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpnav.