Exemplo n.º 1
0
    // Use this for initialization
    void Awake()
    {
        balls           = new List <GameObject>();
        ballTypes       = new GameObject[] { ball, ballBounce, ballCurve, ballWater, ballElectricity, ballVampiric };
        ballsToSpawn    = new List <int>[] { new List <int> {
                                             }, new List <int> {
                                             }, new List <int> {
                                             } };
        ballSpawns      = new float[][] { new float[] { 0, -1.78f, 1.78f }, new float[] { -1.5f, 0, -3f, 1.5f, -4.5f } };
        nextBallSpawn   = 0;
        titleScreenLive = false;
        warmupLive      = false;
        gameLive        = false;

        lightManager       = lights.GetComponent <LightManager>();
        scoreboardManager  = scoreBoard.GetComponent <ScoreboardManager>();
        spotLightManager   = spotLight.GetComponent <SpotlightManager>();
        titleScreenManager = titleScreen.GetComponent <TitleScreenManager>();
        playerManager1     = player1.GetComponent <PlayerManager>();
        playerManager2     = player2.GetComponent <PlayerManager>();

        GenerateBallsToSpawn(0, 0);
        playerManager1.SetBoundaries(team1Boundaries);
        playerManager2.SetBoundaries(team2Boundaries);
    }
Exemplo n.º 2
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Exemplo n.º 3
0
    // Token: 0x06003422 RID: 13346 RVA: 0x000D6A3C File Offset: 0x000D4C3C
    public IEnumerator RestartingCleanupNextFrame()
    {
        this.RemoveGameplayObjects();
        this.ResetInputLocks();
        if (UI.Fader.IsFadingInOrStay() || UI.Fader.IsTimelineFading())
        {
            UI.Fader.FadeOut(2f);
        }
        XboxLiveController.Instance.Reset();
        XboxOneController.ResetCurrentGamepad();
        XboxOneFlow.Engage = false;
        XboxOneSession.EndSession();
        yield return(new WaitForFixedUpdate());

        this.m_isRestartingGame = false;
        this.ActiveObjectives.Clear();
        Game.Checkpoint.SaveGameData = new SaveGameData();
        Events.Scheduler.OnGameSerializeLoad.Call();
        Events.Scheduler.OnGameReset.Call();
        if (UI.Fader.IsFadingInOrStay() || UI.Fader.IsTimelineFading())
        {
            UI.Fader.FadeOut(2f);
        }
        TitleScreenManager.OnReturnToTitleScreen();
        this.CreateCheckpoint();
        yield break;
    }
Exemplo n.º 4
0
        /// <summary>
        /// Se suscribe a los eventos de TitleScreenManager
        /// </summary>
        private static void SubscribeTitleScreenScene()
        {
            TSM = TitleScreenManager.Instance;

            if (enabledDebugUI)
            {
                InstantiateDebugGO();
            }

            if (!titlescreenSubscribed)
            {
                Debug.Log("Suscribiendose a eventos de TitleScreen...");
                TSM.OnUIPageEnabled          += NotifyPageEnabled;
                TSM.OnUIPageDisabled         += NotifyPageDisabled;
                TSM.OnButtonPlayClicked      += NotifyButtonPlayClicked;
                TSM.OnButtonStatsClicked     += NotifyButtonStatsClicked;
                TSM.OnButtonConfigClicked    += NotifyButtonConfigClicked;
                TSM.OnButtonInfoClicked      += NotifyButtonInfoClicked;
                TSM.OnButtonBackClicked      += NotifyButtonBackClicked;
                TSM.OnButtonLanguageClicked  += NotifyButtonLanguageClicked;
                TSM.OnButtonOkClicked        += NotifyButtonOkClicked;
                TSM.OnTitleAnimationFinished += NotifyTitleAnimationFinished;
                Debug.Log("Eventos de TitleScreen suscritos.");
                titlescreenSubscribed = true;
            }
        }
 void OnEnable()
 {
     //Here we grab the SourceAsset rootVisualElement
     //This is a MAJOR KEY, really couldn't find this key step in information online
     //If you want to reference your active UI in a script make a public UIDocument variable and
     //then call rootVisualElement on it, from there you can query the Visual Element tree by names
     //or element types
     m_titleScreenManagerVE = m_TitleUIDocument.rootVisualElement;
     //Here we grab the TitleScreenManager by querying by name
     m_titleScreenManagerClass = m_titleScreenManagerVE.Q <TitleScreenManager>("TitleScreenManager");
     //From within TitleScreenManager we query local-games-list by name
     m_ListView = m_titleScreenManagerVE.Q <ListView>("local-games-list");
 }
    void Awake()
    {
        if (instance == null)
        {
            instance = this;
        }
        else if (instance != this)
        {
            DestroyImmediate(this.gameObject);
        }

        titleScreen.SetActive(false);
    }
Exemplo n.º 7
0
    private void Awake()
    {
        switch (GameManager.Instance.GameState)
        {
        case GameState.TITLE_SCREEN:
            TSM = TitleScreenManager.Instance;
            break;

        case GameState.LEVEL:
            LM = LevelManager.Instance;
            break;
        }
    }
    void Awake()
    {
        // Ensure there can only be one TitleScreenManager
        if (manager == null)
        {
            manager = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (manager != this)
        {
            Destroy(gameObject);
        }

        // Prevent autoselect game window to see the game in scene view. QOL remove before deploy
        //#if UNITY_EDITOR
        //    UnityEditor.SceneView.FocusWindowIfItsOpen(typeof(UnityEditor.SceneView));
        //#endif
    }
Exemplo n.º 9
0
    private IEnumerator SpawnPieces()
    {
        yield return(startWait);

        StartCoroutine(TitleScreenManager.FadeAudioSourceVolume(mainGameAudio, 0.8f, 2f));
        while (true)
        {
            Ossan ossan = allOssan[Random.Range(0, allOssan.Length)];
            SpawnPiece(ossan);
            ossanSinceLastWood++;
            if (ossanSinceLastWood >= 4)
            {
                SpawnPiece(theWoods[Random.Range(0, theWoods.Length)]);
                ossanSinceLastWood = 0;
            }
            yield return(new WaitForSeconds(Random.Range(3f, 5f)));
        }
    }
Exemplo n.º 10
0
    private IEnumerator _EndGame()
    {
        spawner.StopSpawning();
        DragablePiece[] remainingDraggablePieces = FindObjectsOfType(typeof(DragablePiece)) as DragablePiece[];
        for (int i = 0; i < remainingDraggablePieces.Length; i++)
        {
            Destroy(remainingDraggablePieces[i].gameObject);
        }
        endScreen.RecordScore(HudManager.instance.Score);
        StartCoroutine(TitleScreenManager.FadeAudioSourceVolume(mainGameAudio, 0f, 2f));
        yield return(new WaitForSeconds(1f));

        StartCoroutine(TitleScreenManager.FadeAudioSourceVolume(titleScreenAudio, 0.8f, 2f));
        HudManager.instance.Score = 0;
        currentSleepTime          = START_SLEEP_TIME;
        endScreen.container.gameObject.SetActive(true);
        yield return(null);
    }
Exemplo n.º 11
0
        public void Initialize(TitleScreenManager titleScreenManager)
        {
            _anim = titleScreenManager.GetComponent <TitleAnimationController>();
            var menu = titleScreenManager.GetValue <Menu>("_mainMenu");

            Initialize(menu);

            ResumeExpeditionButton = GetTitleButton("Button-ResumeGame");
            NewExpeditionButton    = GetTitleButton("Button-NewGame");
            OptionsButton          = GetTitleButton("Button-Options");
            ViewCreditsButton      = GetTitleButton("Button-Credits");
            SwitchProfileButton    = GetTitleButton("Button-Profile");
            QuitButton             = GetTitleButton("Button-Exit");

            var tabbedMenu = titleScreenManager.GetValue <TabbedMenu>("_optionsMenu");

            OptionsMenu.Initialize(tabbedMenu);
            InvokeOnInit();
        }
Exemplo n.º 12
0
        public static void LoadContent(ContentManager Content)
        {
            FontProvider.AddFont("Pericles8", Content.Load <SpriteFont>(@"fonts/pericles8"));
            FontProvider.AddFont("Pericles9", Content.Load <SpriteFont>(@"fonts/pericles9"));
            FontProvider.AddFont("Pericles14", Content.Load <SpriteFont>(@"fonts/pericles14"));
            FontProvider.AddFont("Pericles21", Content.Load <SpriteFont>(@"fonts/pericles21"));
            FontProvider.AddFont("Mono14", Content.Load <SpriteFont>(@"fonts/mono14"));
            FontProvider.AddFont("Mono21", Content.Load <SpriteFont>(@"fonts/mono21"));

            TitleScreenManager.LoadContent(Content.Load <Texture2D>(@"textures/misc/TitleScreen"));

            VariableProvider.WhiteTexture = Content.Load <Texture2D>(@"textures/misc/white");

            AnimationDictionaryProvider.LoadAnimationStrips(Content);

            MugShotProvider.DummyMugShotAngry  = Content.Load <Texture2D>(@"textures/misc/mugshots/dummyangry");
            MugShotProvider.DummyMugShotNormal = Content.Load <Texture2D>(@"textures/misc/mugshots/dummynormal");

            DialogManager.Initialize();
        }
Exemplo n.º 13
0
 /// <summary>
 /// Ejecutado al instanciar el MonoBehaviour.
 /// Recoge referencias del manager y el animator e inicializa el state.
 /// </summary>
 private void Awake()
 {
     TSM   = TitleScreenManager.Instance;
     anim  = GetComponent <Animator>();
     state = ConfigPageState.MAIN;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Recoge las referencias de los manager e inicializa el valor del toggle.
 /// </summary>
 protected override void InitToggleValue()
 {
     GM  = GameManager.Instance;
     TSM = TitleScreenManager.Instance;
     InitLanguageToggle();
 }
Exemplo n.º 15
0
 /// <summary>
 /// Ejecutado al instanciar el MonoBehaviour.
 /// Recoge referencias del Manager y el animator.
 /// </summary>
 private void Awake()
 {
     TSM  = TitleScreenManager.Instance;
     anim = GetComponent <Animator>();
 }