# Set Purchase Group Unit

Grammar — Set the unit link of purchaseGroup to unitLink
FlagsNative | Action

Sets the unit for the specified purchase group.

# Arguments

  • int<preset::PurchaseGroup> — Purchase Group
  • string<gamelink::Unit> — Unit Link

Returns — void

native void PurchaseGroupSetUnitLink(
	int inPurchaseGroupId,
	string inUnitLink,
);

Category: Story / Tech Purchase Panel / Purchase Groups

# Examples

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7688

                    PurchaseGroupSetState(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], c_purchaseGroupStateNew);
                    libCamp_gv_tSX_TechGroup_UI_New[lv_groupIndex] = true;
                    PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], libCamp_gv_tS_TechGroupUnitType[lv_groupIndex]);
                    libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] += 1;
                }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7932

                    libCamp_gv_tSX_TechCategoryCount[lv_categoryIndex] += 1;
                    PurchaseGroupSetIconFilePath(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], "Assets\\Textures\\blank.dds");
                    PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], libCamp_gv_tS_TechGroupUnitType[lv_groupIndex]);
                    if ((lv_purchasedCounts[lv_groupIndex] == 2)) {
                        PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], "InvisiblePylon");

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7934

                    PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], libCamp_gv_tS_TechGroupUnitType[lv_groupIndex]);
                    if ((lv_purchasedCounts[lv_groupIndex] == 2)) {
                        PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], "InvisiblePylon");
                        PurchaseGroupSetIconFilePath(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], lv_purchasedCounts_Images[lv_groupIndex]);
                    }

campaigns/libertystory.sc2campaignbase.sc2data/TriggerLibs/CampaignLib.galaxy:7939


                    if (((lv_lowMoneyCounts[lv_groupIndex] == 2) || ((lv_lowMoneyCounts[lv_groupIndex] == 1) && (lv_purchasedCounts[lv_groupIndex] == 1)))) {
                        PurchaseGroupSetUnitLink(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], "InvisiblePylon");
                        PurchaseGroupSetIconFilePath(libCamp_gv_tS_TechGroup_UI[lv_groupIndex], lv_lowMoneyCounts_Images[lv_groupIndex]);
                    }