Ejemplo n.º 1
0
        // Setups the single player modals.
        private void SetupSinglePlayerModals()
        {
            OfflineRulesProcessor offlineRulesProcessor = m_RulesProcessor as OfflineRulesProcessor;
            EndGameModal          endGame = offlineRulesProcessor.endGameModal;

            if (endGame == null)
            {
                endGame = m_DefaultSinglePlayerModal;
            }

            InstantiateEndGameModal(endGame);

            if (m_EndGameModal != null)
            {
                m_EndGameModal.SetRulesProcessor(m_RulesProcessor);
            }

            // Handle start game modal
            if (offlineRulesProcessor.startGameModal != null)
            {
                m_StartGameModal = Instantiate(offlineRulesProcessor.startGameModal);
                m_StartGameModal.transform.SetParent(m_EndGameUiParent, false);
                m_StartGameModal.gameObject.SetActive(false);
                m_StartGameModal.Setup(offlineRulesProcessor);
                m_StartGameModal.Show();
                LazyLoadLoadingPanel();
                m_LoadingScreen.transform.SetAsLastSibling();
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Setups the single player modals.
        /// </summary>
        private void SetupSinglePlayerModals()
        {
            //Cache the offline rules processor
            OfflineRulesProcessor offlineRulesProcessor = m_RulesProcessor as OfflineRulesProcessor;
            //Get the end game modal
            EndGameModal endGame = offlineRulesProcessor.endGameModal;

            //If an end game modal is not specified then use the default
            if (endGame == null)
            {
                endGame = m_DefaultSinglePlayerModal;
            }

            InstantiateEndGameModal(endGame);

            if (m_EndGameModal != null)
            {
                m_EndGameModal.SetRulesProcessor(m_RulesProcessor);
            }

            //Handle start game modal
            if (offlineRulesProcessor.startGameModal != null)
            {
                m_StartGameModal = Instantiate(offlineRulesProcessor.startGameModal);
                m_StartGameModal.transform.SetParent(m_EndGameUiParent, false);
                m_StartGameModal.gameObject.SetActive(false);
                m_StartGameModal.Setup(offlineRulesProcessor);
                m_StartGameModal.Show();
                LazyLoadLoadingPanel();
                //The loading screen must always be the last sibling
                m_LoadingScreen.transform.SetAsLastSibling();
            }
        }
Ejemplo n.º 3
0
        public override void Setup(OfflineRulesProcessor rulesProcessor)
        {
            base.Setup(rulesProcessor);

            if (this.m_RulesProcessor != null)
            {
                m_SinglePlayerRulesProcessor = this.m_RulesProcessor as SinglePlayerRulesProcessor;

                Objective[] objectives = m_SinglePlayerRulesProcessor.objectiveInstances;

                int lengthOfArray = objectives.Length;
                //Display the objectives: Primary first then Secondary
                CreateHeading("PRIMARY");
                for (int i = 0; i < lengthOfArray; i++)
                {
                    if (i == 1)
                    {
                        CreateHeading("SECONDARY");
                    }
                    ObjectiveUI newObjectiveUi = Instantiate <ObjectiveUI>(i == 0 ? m_PrimaryObjectiveUiElement : m_ObjectiveUiElement);
                    newObjectiveUi.transform.SetParent(m_ObjectiveList, false);
                    newObjectiveUi.Setup(objectives[i], false);
                }

                m_LevelName.text = m_SinglePlayerRulesProcessor.GetRoundMessage().ToUpper();
            }
        }
Ejemplo n.º 4
0
        private void LazyLoadRuleProcessor()
        {
            if (m_RuleProcessor != null ||
                GameManager.s_Instance == null)
            {
                return;
            }

            m_RuleProcessor = GameManager.s_Instance.rulesProcessor as OfflineRulesProcessor;
        }
Ejemplo n.º 5
0
        //reset game
        public virtual void OnResetClick()
        {
            OfflineRulesProcessor offlineRules = m_RulesProcessor as OfflineRulesProcessor;

            if (offlineRules != null)
            {
                offlineRules.ResetGame();
            }
            CloseModal();
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Setup the specified rulesProcessor.
 /// </summary>
 /// <param name="rulesProcessor">Rules processor.</param>
 public virtual void Setup(OfflineRulesProcessor rulesProcessor)
 {
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Setup the specified rulesProcessor.
 /// </summary>
 /// <param name="rulesProcessor">Rules processor.</param>
 public virtual void Setup(OfflineRulesProcessor rulesProcessor)
 {
     this.m_RulesProcessor = rulesProcessor;
 }