Exemplo n.º 1
0
    public void OnSceneGUI()
    {
        //if(!_mapDrawer)
        //{
        //    return;
        //}

        Vector3 mouseWorldPosition = GetMouseWorldPosition();

        if (_mapDrawer.ValidClick(mouseWorldPosition))
        {
            Event currentEvent = Event.current;
            Debug.LogError(currentEvent.type);
            if (currentEvent.type == EventType.MouseDown ||
                currentEvent.type == EventType.MouseDrag)
            {
                if (currentEvent.button == 0)
                {
                    CreateMapGrid(mouseWorldPosition);
                    currentEvent.Use();
                }

                if (currentEvent.button == 1)
                {
                    currentEvent.Use();
                }
            }
        }
    }