Answer by gfoot
The simplest option for WebGL is to use Javascript itself, executing within the browser. You can load and run scripts dynamically by asking the browser to evaluate them, and with an appropriate jslib...
View ArticleAnswer by gfoot
If you want to pass it straight to a C# function, you need to marshal it somehow. You can either marshal it as an object, and have a C# struct with the same layout that gets filled in, or you can pass...
View ArticleAnswer by gfoot
The simplest way to do this is to take the cube's forward and up vectors, align them to the nearest world axes, and then recalculate the cube orientation using Quaternion.LookRotation. To snap a vector...
View ArticleAnswer by gfoot
I think that's out of date, but you don't need a native plugin anyway. It's easiest to do this using an Android Javascript plugin, which you need to launch as a service when your app is started. This...
View ArticleAnswer by gfoot
Generally, pay attention to the conventions followed by the functions you're calling, and use the appropriate means to handle the error states they generate. So if the function you're calling throws...
View ArticleAnswer by gfoot
Answering specifically how to clamp a 3D "direction" vector to be within a certain angle of some other direction called "forwards": direction = Vector3.RotateTowards( forwards, direction, maxRadians, 0...
View ArticleAnswer by gfoot
Here's a quick guide to the basics of creating a multi-sprite image and importing it into Unity. **Create the image** I use Gimp for this, but any decent 2D art tool should be fine. Start with a...
View ArticleAnswer by gfoot
I'm not sure about the number of lines, but you should be able to get the required height in pixels using GUIStyle.CalcHeight:...
View ArticleAnswer by gfoot
Line 7 does a busy-wait for the request to complete. Depending on the WWW implementation (which varies between platforms), the request may or may not be able to complete in the background - on some...
View ArticleAnswer by gfoot
Do the images have large areas of flat colours? Are they weird shapes? You might be able to split each image into many smaller tiles, and find that many of the tiles are empty, or are filled with just...
View ArticleAnswer by gfoot
Did you use MeshTopology.Lines? If so, the lines should always be one pixel wide. If not, try that - it's a parameter to Mesh.SetIndices.
View ArticleAnswer by gfoot
Full AOT compilation is not supported by Mono on all platforms. Last time I investigated (years ago...) it was supported on amd64, but not x86. So you can perform these tests on 64-bit Intel-based...
View ArticleAnswer by gfoot
Multiply the quaternion by an Euler rotation quaternion like this: transform.rotation = Quaternion.LookRotation(hit.normal) * Quaternion.Euler(0, 0, zAngle); You can also specify a custom "up" axis to...
View ArticleAnswer by gfoot
Try using axis 9 and axis 10 to read the triggers. This has worked for me in the past, but I think I heard that it doesn't work properly when you have multiple Xbox360 pads connected to the same PC....
View ArticleAnswer by gfoot
You can use the underlying iterators without creating the unnecessary garbage - essentially, you write what you would have liked the compiler to generate for you. The basic pattern is: var enumerator =...
View ArticleAnswer by gfoot
They renamed the options, so you can now choose to have explicit meta files or hidden meta files. They are necessary though, and always were, even when they were hidden in the Library folder - you...
View ArticleAnswer by gfoot
I think you need to explicitly specify the type when you declare an uninitialized variable: var Distance : float;
View ArticleAnswer by gfoot
Regarding interpolation and extrapolation, you're right, if the physics frame rate is high then you won't notice much difference. One time when you will particularly notice a difference is if you...
View Article