예제 #1
0
    void Update()
    {
        if (mapControl != null)
        {
            mapControl.Update();

            _mouseStatus.Update();

            if (_mouseStatus.GetMouseJustDown(MouseStatus.KEY.LEFT) &&
                !UICamera.Raycast(Input.mousePosition))
            {
                Vector3 worldPoint;
                Vector3 mousePosition = _mouseStatus.GetMouseJustDownPos();
                bool    raycast       = _campaignCamera.ProjectScreenPointToPlane(out worldPoint, mousePosition);
                if (raycast)
                {
                    int tileIndex = mapControl.DetectTileIndex(worldPoint);
                    if (tileIndex >= 0)
                    {
                        if (_campaignPanel != null)
                        {
                            _campaignPanel.OnSelectMission(tileIndex + 1);
                        }
                    }
                }
            }
        }
    }