public static void SetLoadout(int idPlayer, int iChrSlot, LoadoutManager.Loadout loadout)
    {
        ExitGames.Client.Photon.Hashtable hashNewProperties = new ExitGames.Client.Photon.Hashtable()
        {
            { GetLoadoutKey(idPlayer, iChrSlot), LoadoutManager.SerializeLoadout(loadout) }
        };

        PhotonNetwork.CurrentRoom.SetCustomProperties(hashNewProperties);
    }
Пример #2
0
    public void InitFromLoadout(LoadoutManager.Loadout loadout)
    {
        //Load in all the equipped skills
        for (int i = 0; i < Chr.nEquippedCharacterSkills; i++)
        {
            arSkillSlots[i].SetSkill(loadout.lstChosenSkills[i]);
        }


        //TODO - store all the benched skills as well
    }
Пример #3
0
    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);
        }
    }
Пример #4
0
    // Will eventually need a clean solution to adding/removing characters
    // while managing ids - some sort of Buffer of unused views will probably help
    void InitChr(CharType.CHARTYPE chartype, Player player, int idChar, LoadoutManager.Loadout loadout)
    {
        GameObject goChr  = Instantiate(pfChr, this.transform);
        Chr        newChr = goChr.GetComponent <Chr>();

        if (newChr == null)
        {
            Debug.LogError("ERROR! NO CHR COMPONENT ON CHR PREFAB!");
        }

        newChr.Start();

        newChr.InitChr(chartype, player, idChar, loadout);

        arChrs[player.id][idChar] = newChr;
        player.arChr[idChar]      = newChr;
    }
Пример #5
0
    public void InitWithLoadout(LoadoutManager.Loadout loadout)
    {
        //Set our local loadout to the newly submitted one
        loadoutCur = loadout;

        //Setup the general UI to reflect the new loadout
        inputfieldLoadoutName.text = loadoutCur.sName;

        lstSelectableSkills = SkillType.GetSkillInfosUnderDisciplines(ChrTypeSelectingFor());

        //Loop through all the dropdown skill selectors and initialize them with what options they are set to (and their currently selectable options)
        for (int i = 0; i < ardropdownSkillLoadout.Length; i++)
        {
            //Select the appropriate skill (either equipped or benched) from the current loadout
            ardropdownSkillLoadout[i].Init(loadoutCur.lstChosenSkills[i]);
        }
    }
Пример #6
0
    // Used to initiallize information fields of the Chr
    // Call this after creating to set information
    public void InitChr(CharType.CHARTYPE _chartype, Player _plyrOwner, int _id, LoadoutManager.Loadout loadout)
    {
        chartype  = _chartype;
        sName     = CharType.GetChrName(chartype);
        plyrOwner = _plyrOwner;
        id        = _id;
        globalid  = id + plyrOwner.id * Player.MAXCHRS;

        RegisterChr(this);

        //Initialize this character's disciplines based on their chartype
        InitDisciplines();

        //Initialize any loadout-specific qualities of the character
        InitFromLoadout(loadout);

        view.Init();
    }
Пример #7
0
    public void BeginSelection(int _iPlayerSelectingFor, int _iChrSelectingFor, System.Action _fnOnSelectionComplete, LoadoutManager.Loadout loadoutToStart)
    {
        iPlayerSelectingFor = _iPlayerSelectingFor;
        iChrSelectingFor    = _iChrSelectingFor;

        fnOnSelectionComplete = _fnOnSelectionComplete;

        txtLabel.text = string.Format("Loadout for {0}", CharType.GetChrName(ChrTypeSelectingFor()));

        //Initialize the saved loadouts dropdown
        InitSavedLoadoutsDropdown();

        //Need to initialize the loadout selector with whatever loadout is currently defined for this character in matchsetup
        InitWithLoadout(loadoutToStart);
    }