public void CleanupEditLoadout() { //Save the generated loadout in the slot for the character we were editing NetworkMatchSetup.SetLoadout(idPlayer, loadoutselectActive.iChrSelectingFor, loadoutselectActive.loadoutCur); //Once the loadout editing is done, we can just destroy the loadout selector window, and clear out our reference to it GameObject.Destroy(loadoutselectActive.gameObject); loadoutselectActive = null; }
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)); }