public void SetUnitToActivePartySlot() { PartyUnitSlot active = PartyUnitSlot.Active; UnitData dataOfClass1 = DataSource.FindDataOfClass <UnitData>(((Component)this).get_gameObject(), (UnitData)null); if (!Object.op_Inequality((Object)active, (Object)null)) { return; } PartyData dataOfClass2 = DataSource.FindDataOfClass <PartyData>(((Component)active).get_gameObject(), (PartyData)null); if (dataOfClass1 != null) { for (int index = 0; index < dataOfClass2.MAX_UNIT; ++index) { if (dataOfClass2.GetUnitUniqueID(index) == dataOfClass1.UniqueID) { dataOfClass2.SetUnitUniqueID(index, 0L); } } dataOfClass2.SetUnitUniqueID(active.Index, dataOfClass1.UniqueID); } else { dataOfClass2.SetUnitUniqueID(active.Index, 0L); } FlowNodeEvent <FlowNode_OnPartyChange> .Invoke(); }
public override void OnActivate(int pinID) { if (pinID != 0) { return; } PlayerData player = MonoSingleton <GameManager> .Instance.Player; PlayerPartyTypes type = PlayerPartyTypes.Normal; PartyData partyOfType = player.FindPartyOfType(type); List <UnitData> units = player.Units; List <UnitData> unitDataList = new List <UnitData>(); for (int mainmemberStart = partyOfType.MAINMEMBER_START; mainmemberStart < partyOfType.MAX_MAINMEMBER && mainmemberStart <= units.Count; ++mainmemberStart) { if (!units[mainmemberStart].UnitParam.IsHero()) { unitDataList.Add(units[mainmemberStart]); } } for (int count = unitDataList.Count; count < partyOfType.MAX_UNIT; ++count) { unitDataList.Add((UnitData)null); } for (int index = 0; index < unitDataList.Count; ++index) { long uniqueid = unitDataList[index] == null ? 0L : unitDataList[index].UniqueID; partyOfType.SetUnitUniqueID(index, uniqueid); } this.ExecRequest((WebAPI) new ReqParty(new Network.ResponseCallback(((FlowNode_Network)this).ResponseCallback), false, false, false)); ((Behaviour)this).set_enabled(true); }
public override void OnActivate(int pinID) { if (pinID != 1) { return; } if (Object.op_Inequality((Object)PartyUnitSlot.Active, (Object)null)) { PartyData dataOfClass = DataSource.FindDataOfClass <PartyData>(((Component)PartyUnitSlot.Active).get_gameObject(), (PartyData)null); if (dataOfClass != null) { dataOfClass.SetUnitUniqueID(PartyUnitSlot.Active.Index, 0L); } } this.ActivateOutputLinks(100); }