コード例 #1
0
    void Awake()
    {
        miniGameManager = FindObjectOfType <BaseMiniGameManager>();

        //Getting the fixed bounds for the panning camera
        extents = CameraExtension.OrthographicBounds(Camera.main).extents;
    }
コード例 #2
0
    private void OnMouseUp()
    {
        Debug.Log(m_mousePos + " " + Input.mousePosition);

        //if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
        //{
        //    return;
        //}

        if (CameraExtension.IsPointerOverUIObject())
        {
            return;
        }

        if (15.0f > Vector3.Distance(Input.mousePosition, m_mousePos) && false == LandMineCheckImage.activeInHierarchy)
        {
            if (false == m_isSuccessCheck)
            {
                Uncover();
            }
        }

        m_touchTime      = 0;
        m_isTouching     = false;
        m_isSuccessCheck = false;
    }
コード例 #3
0
        public static void ChartAreaZoom(RadChart rc_graphic)
        {
            CameraExtension cameraExtension = new CameraExtension();

            cameraExtension.SpinAxis    = SpinAxis.XY;
            cameraExtension.ZoomEnabled = true;

            rc_graphic.DefaultView.ChartArea.Extensions.Add(cameraExtension);
        }
コード例 #4
0
    void Awake()
    {
        tutorialManager = FindObjectOfType <TutorialMiniGameManager>();
        manager         = FindObjectOfType <TutorialTurnSystem>();
        currentColor    = GetComponent <Camera>().backgroundColor;
        //Getting the fixed bounds for the panning camera
        extents           = CameraExtension.OrthographicBounds(Camera.main).extents;
        cameraSizeOffsetX = extents.x;
        cameraSizeOffsetY = extents.y;

        if (playerTransform == null && TutorialTurnSystem.players.Count > 0)
        {
            playerTransform = TutorialTurnSystem.players[0].transform;
        }
    }
コード例 #5
0
    private void OnMouseDown()
    {
        //if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
        //{
        //    return;
        //}

        if (CameraExtension.IsPointerOverUIObject())
        {
            return;
        }

        m_mousePos   = Input.mousePosition;
        m_isTouching = true;
        Debug.Log(m_mousePos);
    }
コード例 #6
0
        private static void UnityExtensions()
        {
            BehaviourExtension.Example();
            CameraExtension.Example();
            ColorExtension.Example();
            QFramework.GameObjectExtension.Example();
            GraphicExtension.Example();
            ImageExtension.Example();
            ObjectExtension.Example();
            UnityActionExtension.Example();

            #region RectTransform

            #endregion

            #region Selectable

            #endregion

            #region Toggle

            #endregion
        }
コード例 #7
0
    public void Update()
    {
        //if (UnityEngine.EventSystems.EventSystem.current.IsPointerOverGameObject())
        //{
        //    return;
        //}

        if (CameraExtension.IsPointerOverUIObject())
        {
            return;
        }

        if (Input.GetMouseButtonDown(0))
        {
            m_oldPos    = transform.position;
            m_panOrigin = Camera.main.ScreenToViewportPoint(Input.mousePosition);
        }

        if (Input.GetMouseButton(0))
        {
            Vector3 pos = Camera.main.ScreenToViewportPoint(Input.mousePosition) - m_panOrigin;
            transform.position = m_oldPos + -1 * pos * m_panSpeed;

            m_totalMoveDistance += Vector3.Distance(transform.position, m_oldPos);

            if (20.0f < m_totalMoveDistance)
            {
                m_isDragging = true;
            }
        }

        if (Input.GetMouseButtonUp(0))
        {
            m_totalMoveDistance = 0.0f;
            m_isDragging        = false;
        }
    }
コード例 #8
0
 void Awake()
 {
     cameraSizeOffsetX = CameraExtension.OrthographicBounds(Camera.main.GetComponent <Camera>()).extents.x;
     cameraSizeOffsetY = CameraExtension.OrthographicBounds(Camera.main.GetComponent <Camera>()).extents.y;
 }