1234567891011121314151617 |
- using UnityEngine;
- using System.Collections;
- /// <summary>
- /// Level end prop which will be scale the y position to make it adapt to multiple aspect ratios
- /// The important thing is that the vertical pivots for the sprites are set properly
- /// (namely top or bottom according to whether it should be at the top or bottom of the screen)
- /// </summary>
- public class LevelEndProp : MonoBehaviour
- {
- void Start()
- {
- Vector3 pos = transform.localPosition;
- pos.y = (pos.y / (GameConstants.GAME_HEIGHT/2)) * (AspectRatioFixer.UIManualHeight/2);
- transform.localPosition = pos;
- }
- }
|