# Set Purchase Group Unit
Grammar — Set the unit link of purchaseGroup to unitLink
Flags —Native
|Action
Sets the unit for the specified purchase group.
# Arguments
int
<preset::PurchaseGroup> — Purchase Groupstring
<gamelink::Unit> — Unit Link
Returns — void
native void PurchaseGroupSetUnitLink(
int inPurchaseGroupId,
string inUnitLink,
);
# Related
Category: Story / Tech Purchase Panel / Purchase Groups
- Create Purchase Group —
int
<preset::PurchaseGroup> — PurchaseGroupCreate - Last Created Purchase Group —
int
<preset::PurchaseGroup> — PurchaseGroupLastCreated - Destroy Purchase Group —
void
— PurchaseGroupDestroy - Destroy All Purchase Groups —
void
— PurchaseGroupDestroyAll - Set Purchase Group Name —
void
— PurchaseGroupSetNameText - Set Purchase Group Tooltip —
void
— PurchaseGroupSetTooltipText - Set Purchase Group Slot —
void
— PurchaseGroupSetSlot - Set Purchase Group Unit —
void
— PurchaseGroupSetUnitLink - Set Purchase Group Icon —
void
— PurchaseGroupSetIconFilePath - Set Purchase Group Players —
void
— PurchaseGroupSetPlayerGroup - Set Purchase Group State —
void
— PurchaseGroupSetState
# Examples
campaigns/libertystory.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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.sc2campaign — base.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]);
}