Tag Info

Hot answers tagged

4

Use a logarithmic scale where drawnRadius = log(actualRadius). You then end up with a spacing like this which shows all the planets quite neatly separated: (this representation appears to be using logarithm to base 4) When you want to apply this to your planetary simulation, you first need to convert the carthesian coordinates (x, y) of each planet to ...


2

You have to use StartCoroutine (probably not in the Update) in order to start its execution. Otherwise it's only a method call: void Start() { StartCoroutine(wait(5)); }


2

Short answer: This doesn't do what you think it does. float pressure - A normalized value that describes the pressure applied to the device by a finger or other tool. The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), although values higher than 1 may be generated depending on the calibration of the input device. ...


2

A possible problem is in your SetInStartPosition(). For setting the Y position it should be position.Y = screenBounds.Height - texture.Height... not screenBounds.Width - texture.Width...


2

You will want to use Texture2D.SetPixel or Texture2D.GetPixels and Texture2D.SetPixels if you want to blit sprites onto your texture. You could render your sprites to a RenderTexture. It may be faster but until Unity5 it was a Pro-only feature (which I don't have) so I haven't experimented with it yet. You can't draw individual pixels on the GPU without a ...


2

If you can have objects linked via the inspector and public/serialized fields, you should absolutely do it. It's the best way. FindObjectWithTag is for when your objects don't live in the same scene, and they don't have scripts for registering for each other. And finally, it's useful for when you need to reference a script before Awake has run, so it may not ...


1

As long as the player is alive, you can increase the offset of the texture. Basically the player stays still and the texture moves. Little cheating in this method as it takes around 20 lines of code and isn't fancy.


1

Do not use full screen quads for your light volumes. A simple way is to draw a sphere for each light, in the position that the light occupies and of the same radius. This way, only the fragments actually affected by the light will be affected and your fragment shader will not be executed for the entire screen surface.


1

I think Fuzzy Logic answer is best suited for your question (he got my +1), but i'd like to give a naif alternative. You can setup a bunch of Unity objects like quads, text, sprites (call all that TerminalStuff) and use a separate camera (call it terminalCamera) that capture the terminalStuff (perpendiculary). Then set the render output of terminalCamera to ...



Only top voted, non community-wiki answers of a minimum length are eligible