Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:hermanbanken/LightRailGame into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Rogiervanarkel committed Jan 16, 2015
2 parents 473ff45 + 1c0d321 commit d6589f4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dummy/Assets/Panner.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using System.Collections;
using UnityEngine.EventSystems;
using System;
Expand All @@ -22,7 +22,7 @@ void Update (){
Camera.main.orthographicSize = Math.Max(Camera.main.orthographicSize,20f);
}
else{
Camera.main.orthographicSize = Math.Min(Camera.main.orthographicSize,Background.bounds.size.y / Camera.main.aspect / 2 );
Camera.main.orthographicSize = Math.Min(Camera.main.orthographicSize, (float)Background.bounds.size.y/2/Camera.main.aspect);
}
if (Input.mouseScrollDelta.y != 0)
FixCameraPosition (Vector3.zero, 0);
Expand All @@ -49,7 +49,7 @@ void FixCameraPosition (Vector3 diff, float speed)
var c_w = Camera.main.orthographicSize * Camera.main.aspect;
var c_h = Camera.main.orthographicSize;
var pos = Camera.main.transform.position;
pos.x = Math.Max (Background.bounds.min.y + c_w, Math.Min (Background.bounds.max.x - c_w + rightmenuoffset, pos.x - diff.x * speed));
pos.x = Math.Max (Background.bounds.min.x + c_w, Math.Min (Background.bounds.max.x - c_w + rightmenuoffset, pos.x - diff.x * speed));
pos.y = Math.Max (Background.bounds.min.y + c_h , Math.Min (Background.bounds.max.y - c_h + (10*Camera.main.orthographicSize/88), pos.y - diff.y * speed));
Camera.main.transform.position = pos;

Expand Down

0 comments on commit d6589f4

Please sign in to comment.