public void EditChrLoadout(int iChrToEdit) { if (loadoutselectActive != null) { Debug.LogError("Can't edit another loadout, since we're already editing one"); return; } //Spawn the loadout selector loadoutselectActive = GameObject.Instantiate(pfLoadoutSelector, this.transform.parent).GetComponent <LoadoutSelector>(); loadoutselectActive.BeginSelection(idPlayer, iChrToEdit, CleanupEditLoadout, NetworkMatchSetup.GetLoadout(idPlayer, iChrToEdit)); }
public void OnChrSelectChange() { Debug.Assert(0 <= idChr && idChr < 3); NetworkMatchSetup.SetCharacterSelection(plyrselectorParent.idPlayer, idChr, (CharType.CHARTYPE)dropdown.value); //Now that our character has been reselected, we need to load in a starting loadout for that character NetworkMatchSetup.SetLoadout(plyrselectorParent.idPlayer, idChr, LoadoutManager.LoadSavedLoadoutForChr(NetworkMatchSetup.GetCharacterSelection(plyrselectorParent.idPlayer, idChr), 0)); Debug.LogFormat("Changed chr to {0} with a starting loadout of {1}", NetworkMatchSetup.GetCharacterSelection(plyrselectorParent.idPlayer, idChr), NetworkMatchSetup.GetLoadout(plyrselectorParent.idPlayer, idChr)); }
void InitAllChrs() { for (int i = 0; i < nPlayers; i++) { arChrs[i] = new Chr[Player.MAXCHRS]; arPlayers[i].nChrs = Player.MAXCHRS; for (int j = 0; j < arPlayers[i].nChrs; j++) { InitChr(NetworkMatchSetup.GetCharacterSelection(i, j), arPlayers[i], j, NetworkMatchSetup.GetLoadout(i, j)); } } }
public void LogLoadouts(int iPlayer) { for (int iChr = 0; iChr < Player.MAXCHRS; iChr++) { LoadoutManager.Loadout loadout = NetworkMatchSetup.GetLoadout(iPlayer, iChr); string sLoadout = string.Format("lo:{0}:{1}", iPlayer, iChr); int[] arnSerializedLoadout = LoadoutManager.SerializeLoadout(loadout); sLoadout += LibConversions.ArToStr(arnSerializedLoadout); sLoadout += "\n" + loadout; WriteToMatchLogFile(sLoadout); } }