示例#1
0
        public void CmdSubmitVote(GameObject voteControllerGameObject, int choiceIndex)
        {
            if (!voteControllerGameObject)
            {
                return;
            }
            VoteController component = voteControllerGameObject.GetComponent <VoteController>();

            if (!component)
            {
                return;
            }
            component.ReceiveUserVote(this, choiceIndex);
        }
示例#2
0
        // Token: 0x06000F5E RID: 3934 RVA: 0x0004BE60 File Offset: 0x0004A060
        private void GenerateReportScreens()
        {
            GameOverController.< > c__DisplayClass11_0 CS$ < > 8__locals1 = new GameOverController.< > c__DisplayClass11_0();
            CS$ < > 8__locals1.< > 4__this = this;
            CS$ < > 8__locals1.voteControllerGameObject = base.gameObject;
            VoteController component = CS$ < > 8__locals1.voteControllerGameObject.GetComponent <VoteController>();

            using (IEnumerator <LocalUser> enumerator = LocalUserManager.readOnlyLocalUsersList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    LocalUser           localUser           = enumerator.Current;
                    CameraRigController cameraRigController = CameraRigController.readOnlyInstancesList.FirstOrDefault((CameraRigController v) => v.viewer == localUser.currentNetworkUser);
                    if (cameraRigController && cameraRigController.hud)
                    {
                        GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(this.gameEndReportPanelPrefab, cameraRigController.hud.transform);
                        cameraRigController.hud.mainUIPanel.SetActive(false);
                        gameObject.transform.parent = cameraRigController.hud.transform;
                        gameObject.GetComponent <MPEventSystemProvider>().eventSystem = localUser.eventSystem;
                        GameEndReportPanelController             component2  = gameObject.GetComponent <GameEndReportPanelController>();
                        GameEndReportPanelController.DisplayData displayData = new GameEndReportPanelController.DisplayData
                        {
                            runReport   = this.runReport,
                            playerIndex = CS$ < > 8__locals1.< GenerateReportScreens > g__FindPlayerIndex | 0 (localUser)
                        };
                        component2.SetDisplayData(displayData);
                        component2.continueButton.onClick.AddListener(delegate()
                        {
                            if (localUser.currentNetworkUser)
                            {
                                localUser.currentNetworkUser.CallCmdSubmitVote(CS$ < > 8__locals1.voteControllerGameObject, 0);
                            }
                        });
                        GameObject gameObject2 = UnityEngine.Object.Instantiate <GameObject>(Resources.Load <GameObject>("Prefabs/UI/VoteInfoPanel"), (RectTransform)component2.continueButton.transform.parent);
                        gameObject2.transform.SetAsFirstSibling();
                        gameObject2.GetComponent <VoteInfoPanelController>().voteController = component;
                    }
                }
            }
        }