コード例 #1
0
        void Start()
        {
            if (GameManager.Instance.CursorActive)
            {
                AppEvent.InvokeMouseCursorEnable(false);
            }

            CrosshairStartPosition = new Vector2(Screen.width / 2f, Screen.height / 2f);

            // set horizontal offset
            HorizontalOffset            = (Screen.width * CrosshairHorizontalPercentage) / 2f;
            MinHorizontalDeltaConstrain = -(Screen.width / 2f) + HorizontalOffset;
            MaxHorizontalDeltaConstrain = (Screen.width / 2f) - HorizontalOffset;


            // set vertical offset
            VerticalOffset            = (Screen.height * CrosshairVerticalPercentage) / 2f;
            MinVerticalDeltaConstrain = -(Screen.height / 2f) + VerticalOffset;
            MaxVerticalDeltaConstrain = (Screen.height / 2f) - VerticalOffset;
        }