GithubHelp home page GithubHelp logo

unitychaoslist's Introduction

UnityChaosList

Common faults i found while using Unity

Unity is not Thread-Safe

You cannot call GUI-Elements or even other Unity internal related functions from another thread.
If you do that, Unity will NOT give you an error, it will implode in itself silently.
Your Monobehaviour-Script will just stop executing but not stop running. Like a zombie, it will remain.
Thats why there is no error, it did not technically fail.. it just locks up.

Either Monobehaviour or not

If you intent to use inheritence, good luck.
As C# does not allow multible class-inheritence and Monobehaviour blocks the only one, you are required to make chain-inheritence.
Classes that do not use Monobehavior can be used as normal, its really just a smal inconvinience but still.

MONO does not like beeing told that stuff is UTF-8

string myString = new string(myStringBuffer, 0, myStringBufferLength, System.Text.Encoding.UTF8);	

The fix is to just not tell. Otherwise it will fail internally while parsing the buffer.

string myString = new string(myStringBuffer, 0, myStringBufferLength);	

Unity - UWP / Hololens is can't use directly pinned memory.

Reference rewriter: Error: method System.Char& modreq(System.Runtime.InteropServices.InAttribute) System.String::GetPinnableReference() doesn't exist in target framework

fixed(char* myStringAdress = myString)
{
  // Do stuff
}		

The fix is solved by adding "ToCharArray()" to the string instead of letting the language handle the problem.
There seems to be a hidden function call that does not exists in this older version.

fixed(char* myStringAdress = myString.ToCharArray())
{
  // Do stuff
}		

Unity - Hololens 1 is using the Universal Windows Platform (UWP)

This requires to export as UWP in the build settings in Unity but also has effect on external DLLs.
If you want to use C code in your Hololens 1 project, too bad. As the UWP-System does not compile under strict C-Code rules.
You NEED to compile as C++, meaning you need to use .cpp extension and have the correct compiler seiitings set up.
Additionally you are forced into compiling your DLL as expected but as a UWP DLL.
You need to change some settings to use the C++/CX Windows runtime system.
Microsoft Guide This way of setting up did not work for me.

Annoying but working solution is to just make a new project "DLL C++/CX UWP" and just make a wrapper library.

unitychaoslist's People

Contributors

bitpaw avatar

Watchers

 avatar

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.