Unity: Camera screen resolution


The orthographicSize property defines the viewing volume of an orthographic Camera. In order to edit this size, set the Camera to be orthographic first through script or in the Inspector. The orthographicSize is half the size of the vertical viewing volume. The horizontal size of the viewing volume depends on the aspect ratio.


Using Camera > Projection > Ortographic, Unity will only take the Vertical units as the one being rendered onscreen, THEN render the horizontal lines that fit.

For example:

If you've set the Camera Size to 10, the playing area in Unity Editor will be 20x20 units, which is denoted by the lines (remember, the size is counted starting from the center, so 10 to the left, 10 to the right, 10 upwards, 10 downwards, so 20x20).

Then, let's say you try to publish on a screen that is 300x400  resolution. Then, Unity will fit 20 units vertically at first so that it fits the screen. So each unit will have 400/20 = 20 pixels.

However, the screen only has 300 pixels horizontally. So the screen can only fit 300/20 = 15 Unity units. So only 7.5 Unity units from the origin will be rendered horizontally. So the whole thing being rendered in Unity units is 20x15. 

Make sense?

How about the UI?


1. On your canvas, set the Canvas Scaler component's Ui Scale Mode to Scale with Screen Size. Then you can define a Reference Resolution of 1080p, i.e. 1920 x 1080.

2. To see the canvas fit into the camera's size in the scene, change the Canvas component's Render Mode to Screen Space - Camera, and drag the camera from the hierarchy to it.

3. Me: Set the UI Scale Mode to Scale with Screen Size

4. Me: Lastly, set the Screen Match Mode to "Match Width or Height". Then, set the "Match" value to "Height" (You can also set it to 0.5 if your game is both horizontal/vertical). So now the canvas will act like a Camera as well, will first adjust to the correct height first, then fill in the rest.


youtube: https://www.youtube.com/watch?v=svyDgYz5idg



Modern Mobile Game Design

I'll be looking for resources about Modern Mobile Game Design and list them below. Basically this post will be a placeholder until I actually have a grip hold of the most important ones, or enough to design a good mobile game.

  • Very short tutorial length
  • Get rid of main menu if possible. The player should immediately play the game after launching it. 
    • First time open, immediately play. Then from game over screen can return to main menu (or the game over screen is main menu itself, depend on game).
    • On second open onwards, open the main menu (some games save state when exit and start there?)  .
  • Game mechanic that is not immediately understandable after 2 second of playing? Back to the drawing board.
  • See Voodoo or Ketchapps game (Dunk Shot, Rider, Dunk Hoop)


Git cannot clone remote repository


This one:



I am getting this same error in 15.2 (26430.12). I tried the above best solution and it did not resolve my error. I could repeatedly reproduce this issue if I went to:

  1. "Manage Connections"
  2. "Connect to a Project"
  3. Selected any repository
  4. selected "Connect"
  5. Try to clone from the Team Explorer window

Almost all of the repo is cloned and at the very end I get the CloneCommand.ExecuteClone error.

However if got to

  1. "Manage Connections"
  2. "Connect to a Project"
  3. Selected any repository
  4. selected "Clone"

then the repo will successfully clone. Again, I tried the best solution above and it did not work.

Xamarin.iOS: Showing ActivityIndicator while waiting for TableView to load


    class ViewController: UITableViewController {
        weak var activityIndicatorView: UIActivityIndicatorView!

        override func viewDidLoad() {
            let activityIndicatorView = UIActivityIndicatorView(activityIndicatorStyle: UIActivityIndicatorViewStyle.Gray)
            tableView.backgroundView = activityIndicatorView
            self.activityIndicatorView = activityIndicatorView



..or this if you don't want to use background:



...Or if you want to do on a Static TableView so you need to hide the rows/sections:


(you can't do TableView.Hidden = false because then you get a black screen)


...Animation during reloads