public ViewBase(Rect rect) { var k = ResizeHelper.k; _rect = rect; _innerRect = new Rect(rect.x + 8f * k, rect.y + 8f * k, rect.width - 16f * k, rect.height - 16f * k); _border = ResizeHelper.Make(new Color32(20, 93, 134, 200)); _bg = ResizeHelper.Make(new Color(1, 1, 1, 0.8f)); }
// Use this for initialization void Start() { k = ResizeHelper.k; for (int i = 0; i < _rectsIcon.Length; i++) { _rectsIcon[i] = new Rect(16f * k, 16f * k + i * 70f * k, 64f * k, 64f * k); _rectsWithIcon[i] = new Rect(16f * k + 64f * k, 16f * k + i * 70f * k, 200f * k, 64f * k); _rectsWithoutIcon[i] = new Rect(16f * k, 16f * k + i * 70f * k, 200f * k + 64f * k, 64f * k); } _touch = Camera.main.GetComponent <NewMouseController>(); _touch.Click += HandleTouchClick; _details = this.GetComponent <MarkerDetailsView>(); DescriptionBG = ResizeHelper.Make(new Color32(20, 93, 134, 255)); var size = ResizeHelper.ButtonStyle.CalcSize(new GUIContent(Lang.Settings_Back)); _backRect = new Rect(Screen.width - 10f * k - size.x, Screen.height - 50f * k, size.x, 50f * k); }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////// void SafeInit() { if (_inited) { return; } _inited = true; float k = ResizeHelper.k; _touch = Camera.main.GetComponent <NewMouseController>(); _touch.Click += HandleTouchClick; _touch.MouseDown += HandleMouseDown; _touch.MouseUp += HandleMouseUp; _touch.MouseMove += HandleMouseMove; _markerLister = this.GetComponent <MarkersLister>(); _darkBlue = ResizeHelper.Make(new Color32(15, 70, 102, 255)); _mediumBlue = ResizeHelper.Make(new Color32(20, 93, 134, 255)); _lightBlue = ResizeHelper.Make(new Color32(29, 133, 192, 255)); _closeRect = new Rect(Screen.width - 30f * k, 0, 30f * k, 30f * k); }
// Use this for initialization void Start() { _bg = ResizeHelper.Make(new Color(1, 1, 1, 0.5f)); _rect = new Rect(0, 0, Screen.width, Screen.height); }