|
触发器是,当点击该单位时,切换单位控制权给点击玩家。关键代码如下:
[codes=galaxy]
bool SelectHero_LockCam(int player,unit unitselect)
{
UnitSetOwner(unitselect,player,true);
UnitSelect(unitselect,player,true);
CameraLookAtUnit(player,unitselect);
return true;
}
bool gt_SelectHero_Func (bool testConds, bool runActions)
{
int lv_pl; unit lv_un;
lv_pl = 0; lv_un = null;
if (!runActions) { return true; }
lv_pl=EventPlayer();
lv_un=EventUnit();
SelectHero_LockCam(lv_pl,lv_un);
return true;
}
void gt_SelectHero_Init ()
{
gt_SelectHero = TriggerCreate("gt_SelectHero_Func");
TriggerAddEventUnitClick(gt_SelectHero, UnitRefFromUnit(UnitFromId(1)), c_playerAny);
}
[/codes]
编译通过了,但是测试的时候完全没反应~~~~代码上有什么问题吗? |
|