Пример #1
0
 static void OnSceneGUI(SceneView sceneView)
 {
     if (windows == null)
     {
         return;
     }
     if (Event.current.type == EventType.MouseDown && Event.current.button == 1)
     {
         Ray        ray = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
         RaycastHit hit;
         if (Physics.Raycast(ray, out hit, 100, 1 << MapManager.interactivePanel.interactiveLayerIndex))
         {
             Vector3    localPos = UnityTools.GetLocalPos(mapManager.interactivePanel.transform, hit.point);
             Vector2Int index    = new Vector2Int((int)localPos.x, (int)localPos.y);
             mapManager.map.SetID(index, windows.selectID);
         }
     }
 }