public void Start() { lstLoadoutSelected = new List <LoadoutManager.Loadout>(); //Initially save the selected loadouts as just being the default loadout for the default character in that position for (int i = 0; i < arDropdownCharSelect.Length; i++) { //Initially set the selected char to the default for that player+slot combo NetworkMatchSetup.SetCharacterSelection(idPlayer, i, CHRSELECTIONSDEFAULT[idPlayer, i]); //Set the loadout to be the default loadout for the selected player NetworkMatchSetup.SetLoadout(idPlayer, i, LoadoutManager.LoadSavedLoadoutForChr(CHRSELECTIONSDEFAULT[idPlayer, i], 0)); //Set the default position of that character NetworkMatchSetup.SetPositionCoords(idPlayer, i, POSITIONSDEFAULT[idPlayer, i]); //Ensure our character selection dropdown is initialized arDropdownCharSelect[i].UpdateDropdownOptions(); } }
public void LoadLoggedPositionCoords(string[] arsSplitLogs) { Debug.Assert(arsSplitLogs[0] == "pc"); int iPlayer, iChr, nSerializedCoords; if (int.TryParse(arsSplitLogs[1], out iPlayer) == false || iPlayer < 0 || iPlayer >= Player.MAXPLAYERS) { Debug.LogErrorFormat("Error! {0} was not a valid player id to be loaded", arsSplitLogs[1]); return; } if (int.TryParse(arsSplitLogs[2], out iChr) == false || iChr < 0 || iChr >= Player.MAXCHRS) { Debug.LogErrorFormat("Error! {0} was not a valid chr id to be loaded", arsSplitLogs[2]); return; } if (int.TryParse(arsSplitLogs[3], out nSerializedCoords) == false) { Debug.LogErrorFormat("Error! {0} was not a valid serialized coordinates to be loaded", arsSplitLogs[3]); return; } NetworkMatchSetup.SetPositionCoords(iPlayer, iChr, Position.UnserializeCoords(nSerializedCoords)); }