public void TriggerEvent()
    {
        if (!InGameEventType.TryParse(eventTypeDropDown.options[eventTypeDropDown.value].text, out InGameEventType eventType))
        {
            return;
        }

        var index = nextDropDown.value;

        if (eventType == InGameEventType.Random)
        {
            index = 0;
        }

        if (index != 0)         // Index 0 (Random Event) will never have a parameter page
        {
            // Instead of triggering the event right away, if we have an extra parameter page, we show it
            List <EventScriptBase> listEvents = InGameEventsManager.Instance.GetListFromEnum(eventType);
            if (listEvents[index - 1].parametersPageType != ParametersPageType.None)
            {
                GameObject parameterPage = eventsParametersPages.eventParameterPages.FirstOrDefault(p => p.ParametersPageType == listEvents[index - 1].parametersPageType).ParameterPage;

                if (parameterPage)
                {
                    parameterPage.SetActive(true);
                    parameterPage.GetComponent <SicknessParametersPage>().SetBasicEventParameters(index, isFakeToggle.isOn, announceToggle.isOn, InGameEventType.Fun);
                    return;
                }
            }
        }

        ServerCommandVersionFourMessageClient.Send(ServerData.UserID, PlayerList.Instance.AdminToken, index, isFakeToggle.isOn, announceToggle.isOn, eventType, "CmdTriggerGameEvent");
    }
예제 #2
0
        public void StartInfection()
        {
            SicknessEventParameters eventParameters = new SicknessEventParameters();

            eventParameters.PlayerToInfect = Convert.ToInt32(NumberOfPlayerInput.textComponent.text);
            eventParameters.SicknessIndex  = sicknessDropdown.value;

            ServerCommandVersionFourMessageClient.Send(ServerData.UserID, PlayerList.Instance.AdminToken, index, fakeEvent, announceEvent, eventType, "CmdTriggerGameEvent", eventParameters);

            // We hide the panel
            gameObject.SetActive(false);
        }
예제 #3
0
    public void TriggerEvent()
    {
        if (!InGameEventType.TryParse(eventTypeDropDown.options[eventTypeDropDown.value].text, out InGameEventType eventType))
        {
            return;
        }

        var index = nextDropDown.value;

        if (eventType == InGameEventType.Random)
        {
            index = 0;
        }

        ServerCommandVersionFourMessageClient.Send(ServerData.UserID, PlayerList.Instance.AdminToken, index, isFakeToggle.isOn, announceToggle.isOn, eventType, "CmdTriggerGameEvent");
    }