Beispiel #1
0
        void CmdAssignPerk(int choice)
        {
            var perkChoice = perkChoiceArray[choice];

            perksApplied.Add(perkChoice.Perk.ApplyPerk(NextPerkLevel(perkChoice.Perk)));

            availablePerks--;
            perksCreated = false;

            var showUiMsg = new GrantPerkMessage()
            {
                player = this.gameObject,
                perkChoiceIds = null
            };
            NetworkServer.SendToClient(connectionToClient.connectionId, MessageTypes.PerkDone, showUiMsg);
            OnHidePerkUi();
        }
Beispiel #2
0
        void CreateAvailablePerks()
        {
            var shuffledPerks = allPerks.Shuffle().Take(perkChoices).OrderBy(x => x.GUID).ToArray();
            var perkIds = shuffledPerks.Take(perkChoices).Select(x => GetTypeId(x)).ToArray();
            SetupPerkChoices(perkIds);

            var showUiMsg = new GrantPerkMessage()
            {
                player = this.gameObject,
                perkChoiceIds = perkIds
            };
            NetworkServer.SendToClient(connectionToClient.connectionId, MessageTypes.GrantPerk, showUiMsg);
            perksCreated = true;
        }