Exemplo n.º 1
0
        private void OnEnable()
        {
            Instance   = this;
            MainCamera = GetComponent <Camera>();
            if (Application.isMobilePlatform)
            {
                if (input == null)
                {
                    input = new TouchInput();
                }
                else
                {
                    if (input == null)
                    {
                        input = new MouseInput();
                    }
                }


                input.Initialize(MainCamera);
                input.onDragStart   += OnDragStart;
                input.onDrag        += OnDrag;
                input.onScale       += OnScale;
                input.onDoubleClick += OnDoubleClick;

                MapScreenPoint = MainCamera.WorldToScreenPoint(new Vector3(0.0f, 0.0f, MapZAxis));

                SetCameraOrthographicSize(DefaultOrthographisSize);
            }
        }
Exemplo n.º 2
0
        private void OnEnable()
        {
            Instance           = this;
            camera             = GetComponent <Camera>();
            camera.fieldOfView = defaultFov;

            if (Application.isMobilePlatform)
            {
                if (input == null)
                {
                    input = new TouchInput();
                }
                input.Initialize(camera, MobileScaleFactor);
            }
            else
            {
                if (input == null)
                {
                    input = new MouseInput();
                }
                input.Initialize(camera, 1);
            }

            input.onDrag        += OnDrag;
            input.onScale       += OnScale;
            input.onDoubleClick += OnDoubleClick;

            OnScale(0.1f);
            CalculateBound();
        }