Exemple #1
0
    private static void SceneGUI(SceneView scene)
    {
        if (Event.current.type == EventType.DragUpdated)
        {
            Ray        ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
            RaycastHit hit;
            if (Physics.Raycast(ray, out hit))
            {
                Debug.Log(hit.point);
                HexGrid.ColorCell(HexGrid.GetCell(hit.point), activeColor);
            }
        }

        if (Event.current.type == EventType.DragExited)
        {
            HexGrid.AddModelToSelf(SceneEditorWindow.targetGameObject);
        }
    }