예제 #1
0
    private void EditSafeArea()
    {
        Event e = Event.current;

        if (e.button == 0 && e.type == EventType.MouseDown)
        {
            Ray        ray = HandleUtility.GUIPointToWorldRay(e.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit, Mathf.Infinity, m_layer))
            {
                EditSelectSquare square = m_infoTileTool.TryGetSubArea(m_selectAreaIndex);
                square.AddPoint(CreatePoint(hit.point, square.parent.transform));
            }
        }
    }
예제 #2
0
    void OnSceneGUI()
    {
        Event e = Event.current;

        if (m_startEditorWork)
        {
            /*
             * if (e.button == 1 && e.type == EventType.MouseDown)
             * {
             *  Ray ray = HandleUtility.GUIPointToWorldRay(e.mousePosition);
             *  RaycastHit hit;
             *  if (Physics.Raycast(ray, out hit, Mathf.Infinity, m_layer))
             *  {
             *      m_infoTileTool.SetSquareType(hit.transform.gameObject, m_selectArea);
             *  }
             * }*/
            /*
             * if (e.button == 0 && e.type == EventType.MouseDown)
             * {
             *  Ray ray = HandleUtility.GUIPointToWorldRay(e.mousePosition);
             *  RaycastHit hit;
             *  if (Physics.Raycast(ray, out hit, Mathf.Infinity, m_layer))
             *  {
             *      m_infoTileTool.SetSelectStartPoint(hit.point);
             *  }
             * }
             * else if (e.button == 0 && e.type == EventType.MouseUp)
             * {
             *  Ray ray = HandleUtility.GUIPointToWorldRay(e.mousePosition);
             *  RaycastHit hit;
             *  if (Physics.Raycast(ray, out hit, Mathf.Infinity, m_layer))
             *  {
             *      m_infoTileTool.BoxSelection(hit.point, m_selectArea);
             *  }
             * }*/
            /*
             * if (m_selectAreaIndex == BarrierArea)
             * {
             *
             * }
             * if (m_selectAreaIndex == BornArea)
             * {
             *
             * }
             * if (m_selectAreaIndex == CollectArea)
             * {
             *
             * }
             *
             * if (m_selectAreaIndex == JumpArea)
             * {
             *
             * }
             *
             * if (m_selectAreaIndex == MonsterArea)
             * {
             *
             * }
             *
             * if (m_selectAreaIndex == NormalArea)
             * {
             *
             * }
             *
             * if (m_selectAreaIndex == PortolArea)
             * {
             *
             * }
             *
             * if (m_selectAreaIndex == RebornArea)
             * {
             *
             * }
             *
             * if (m_selectAreaIndex == SafeArea)
             * {
             *
             * }*/
            if (e.button == 0 && e.type == EventType.MouseDown)
            {
                Ray        ray = HandleUtility.GUIPointToWorldRay(e.mousePosition);
                RaycastHit hit;
                if (Physics.Raycast(ray, out hit, Mathf.Infinity, m_layer))
                {
                    EditSelectSquare square = m_infoTileTool.TryGetSubArea(m_selectAreaIndex);
                    if (square != null)
                    {
                        square.AddPoint(CreatePoint(hit.point, square.parent.transform));
                    }
                }
            }
        }
    }