Esempio n. 1
0
    public void UpdatetileUI(int missionMagicId)
    {
        int missionId = DataMission.GetMissionId(missionMagicId);

        int tileIndex = missionId - 1;

        if (tileIndex >= 0)
        {
            mapControl.SelectTile(tileIndex);
        }
    }
Esempio n. 2
0
    public void UpdatePageUI(int missionMagicId)
    {
        FreeMapControl();

        DataConfig.MISSION_DIFFICULTY difficulty = DataMission.GetDifficulty(missionMagicId);
        int stageId   = DataMission.GetStageId(missionMagicId);
        int missionId = DataMission.GetMissionId(missionMagicId);

        // TODO 强制战役背景资源 ID 为1
//		stageId = 1;

        DataMissionGroup.DataCampaign campaign = DataManager.instance.dataMissionGroup.GetCampaign(difficulty, stageId);
        mapControl = new CampaignMapControl(campaign, missionId - 1);

        int tileIndex = missionId - 1;

        if (tileIndex >= 0)
        {
            mapControl.SelectTile(tileIndex);
        }
    }
Esempio n. 3
0
    // Update is called once per frame
    void Update()
    {
        mapControl.Update();
//		return;

        _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)
                {
                    mapControl.SelectTile(tileIndex);
                }
            }
        }
    }