void Awake()
        {
            var levelsFolder = GameObject.Find("Levels");

            if (levelsFolder == null)
            {
                Debug.Log($"{nameof(BeatLayerSwitchObserver)}: Couldn't find Levels object");
                Destroy(this);
                return;
            }

            var menuSystemObj = GameObject.Find("_MenuSystem");

            if (menuSystemObj != null)
            {
                _menuSystem = menuSystemObj.GetComponent <MenuSystem>();
            }
            else
            {
                Debug.Log($"{nameof(BeatLayerSwitchObserver)}: Couldn't find _MenuSystem object");
            }

            _bossGate = levelsFolder.GetComponentInChildren <BossGate>();

            var beatswitches = levelsFolder.GetComponentsInChildren <BeatLayerSwitch>();
            var colorSpheres = beatswitches.Select(b => b.colorSphere);

            if (_menuSystem != null)
            {
                colorSpheres = colorSpheres.Where(c => c != _menuSystem.colorSphere);
            }

            _beatSwitchColorSpheres = colorSpheres.ToArray();
        }
    public override void OnGotFocus()
    {
        base.OnGotFocus();
        MenuSystem menuSystem = MenuSystem.instance;

        menuSystem.InputDeviceChange = (Action <MenuSystem.eInputDeviceType>)Delegate.Combine(menuSystem.InputDeviceChange, new Action <MenuSystem.eInputDeviceType>(OnInputDeviceChange));
        OnInputDeviceChange(MenuSystem.instance.GetCurrentInputDevice());
        ButtonLegendBar.instance.ToogleCarouselLegend(state: true);
        list.onSelect       = OnSelect;
        list.onSubmit       = OnSubmit;
        list.onPointerClick = OnPointerClick;
        checkpointToStart   = -1;
        if (!IsLobbyMode())
        {
            if (NetGame.instance.currentLevelType == WorkshopItemSource.Subscription)
            {
                displayMode = LevelSelectMenuMode.SubscribedWorkshop;
            }
            if (isMultiplayer && displayMode == LevelSelectMenuMode.LocalWorkshop)
            {
                displayMode = LevelSelectMenuMode.SubscribedWorkshop;
            }
        }
        NetGame.instance.transport.RegisterForGameOverlayActivation(OnGameOverlayActivation);
        Rebind();
        triggerRefresh = false;
    }
Esempio n. 3
0
    public void Awake()
    {
        sysRand    = new System.Random();
        blockList  = new List <Block>();
        colorDict  = new Dictionary <int, Color>();
        blockArray = new Block[51];
        goArray    = new GameObject[51];
        menSys     = gameObject.GetComponent <MenuSystem>();

        colorDict.Add(0, Color.white);
        colorDict.Add(1, Color.red);
        colorDict.Add(2, Color.green);
        colorDict.Add(3, Color.blue);
        colorDict.Add(4, Color.black);

        goArray = GameObject.FindGameObjectsWithTag(BLOCK_TAG);

        //Loop over game object array and assign random color to each object
        for (int i = 0; i < goArray.Length; i++)
        {
            blockArray[i] = goArray[i].gameObject.GetComponent <Block>();

            int   rand = BiasedRandomNumber(0, 5);
            Color newColor;
            if (true == colorDict.TryGetValue(rand, out newColor))
            {
                blockArray[i].ChangeBlockCollor(newColor);
                blockArray[i].CurrentBlockType = (BlockTypes)rand;
            }
        }
        blockList.AddRange(blockArray);
    }
Esempio n. 4
0
 private void Start()
 {
     if (IsFirstScreen)
     {
         MenuSystem.OpenMenu(this, true);
     }
 }
Esempio n. 5
0
    private void InitGameRoot()
    {
        //1. Init all services
        //a. Resource service
        resourceService = GetComponent <ResourceService>();
        resourceService.InitService();

        //b. Audio service
        audioService = GetComponent <AudioService>();
        audioService.InitService();

        //2. Init all systems
        //a. Menu System
        menuSystem = GetComponent <MenuSystem>();
        menuSystem.InitSystem();

        //b. Puzzle System
        puzzleSystem = GetComponent <PuzzleSystem>();
        puzzleSystem.InitSystem();

        //3.Enter Menu Scene
        if (SceneManager.GetActiveScene().name == Constants.gameRootSceneName)
        {
            menuSystem.EnterMenu();
        }
    }
Esempio n. 6
0
    private void Awake()
    {
        DontDestroyOnLoad(this);
        menuSystem = GetComponent <MenuSystem>();

        EditorPlayerSpawner.CanSpawn = false;
    }
Esempio n. 7
0
        private void Awake()
        {
            MenuSystem.OpenMenu(LobbyScreen, true);

            EventSystem.Subscribe <StartGameEvent>(OnStartGame, this);
            EventSystem.Subscribe <RoundStartedEvent>(OnRoundStarted, this);
        }
Esempio n. 8
0
 private void Start()
 {
     menuSystem = FindObjectOfType <MenuSystem>();
     fileIO     = FindObjectOfType <JsonFileIO>();
     SetValue(ChoiceTextInput);
     SetValue(ChoiceChapterInput);
 }
Esempio n. 9
0
    void Start()
    {
        instance = this;

        // cache references to our player and level manager objects
        player       = GameObject.FindObjectOfType <PlayerControl>();
        levelManager = GameObject.FindObjectOfType <LevelManager>();

        // cache some references to various menu screens and so on
        menuSystem  = GameObject.FindObjectOfType <MenuSystem>();
        mainMenu    = menuSystem.GetScreen("MainMenu");
        pauseMenu   = menuSystem.GetScreen("PauseMenu");
        restartMenu = menuSystem.GetScreen("RestartMenu");
        storeMenu   = menuSystem.GetScreen("StoreMenu");
        screenFade  = GameObject.Find("ScreenFade").GetComponent <CanvasGroup>();
        infoPopup   = GameObject.FindObjectOfType <InfoPopup>();

        // find our full screen effects
        motionBlur = GameObject.FindObjectOfType <CameraMotionBlur>();
        screenBlur = GameObject.FindObjectOfType <BlurOptimized>();

        // start with the screen fader opaque
        screenFade.alpha = 1.0f;

        creditMultiplier = 1.0f;

        CheckShopItemIDs();
        InitFullscreenEffects();

        OnEnterStateMenus();
    }
Esempio n. 10
0
 /// <summary>
 /// menus
 /// </summary>
 private LoadingScreen(MenuSystem menuSystem, bool loadingIsSlow, string levelName)
 {
     this.loadingIsSlow = loadingIsSlow;
     this.levelName = levelName;
     this.background = Stage.Content.Load<Texture2D>("Menu/background");
     TransitionOnTime = TimeSpan.FromSeconds(0.5);
 }
 // Função que realizar o Login
 private void buttonLogin_Click(object sender, EventArgs e)
 {
     if (textBoxLUser.Text == "" || textBoxLPassword.Text == "")
     {
         MessageBox.Show("Preencha os campos obrigatórios!");
     }
     else
     {
         int loginValue = CountRegistros($"SELECT COUNT(*) FROM `Usuario` WHERE `Nome` LIKE '{textBoxLUser.Text}' AND `Senha` LIKE '{textBoxLPassword.Text}'", connection);
         if (loginValue == 0)
         {
             MessageBox.Show("Usuário ou senha errado!");
         }
         else
         {
             MenuSystem menuSystem = new MenuSystem();
             if (MessageBox.Show("Login efetuado com sucesso!") == DialogResult.OK)
             {
                 menuSystem.UserLogin(textBoxLUser.Text);
                 menuSystem.Acesso();
                 menuSystem.Show();
                 this.Hide();
             }
         }
     }
 }
Esempio n. 12
0
 void Start()
 {
     menuSystem = FindObjectOfType <MenuSystem>();
     fileIO     = FindObjectOfType <JsonFileIO>();
     ManageVariables(ActionType, true);
     SetValues();
 }
Esempio n. 13
0
    void DrawJoinMultiplayer()
    {
        MenuSystem.BeginMenu("Join Multiplayer");

        if (wwwRequest == null && servers == null)
        {
            wwwRequest = new WWW(CubeworldWebServerServerList);
        }

        if (servers == null && wwwRequest != null && wwwRequest.isDone)
        {
            servers = wwwRequest.text.Split(';');
        }

        if (wwwRequest != null && wwwRequest.isDone)
        {
            foreach (string s in servers)
            {
                string[] ss = s.Split(',');

                if (ss.Length >= 2)
                {
                    MenuSystem.Button("Join [" + ss[0] + ":" + ss[1] + "]", delegate()
                    {
                        gameManagerUnity.worldManagerUnity.JoinMultiplayerGame(ss[0], System.Int32.Parse(ss[1]));

                        availableConfigurations = null;

                        wwwRequest = null;
                        servers    = null;

                        state = MainMenuState.NORMAL;
                    }
                                      );
                }
            }

            MenuSystem.Button("Refresh List", delegate()
            {
                wwwRequest = null;
                servers    = null;
            }
                              );
        }
        else
        {
            MenuSystem.TextField("Waiting data from server..");
        }

        MenuSystem.LastButton("Back", delegate()
        {
            wwwRequest = null;
            servers    = null;
            state      = MainMenuState.NORMAL;
        }
                              );

        MenuSystem.EndMenu();
    }
    private void Start()
    {
        var sceneLoader = new SceneLoader(nextLevel_);

        menuSystem_ = new MenuSystem(menuBehaviour_, spawnableBehaviour_);
        gameLogic_  = new GameLogic(starBehaviours_, goalBehaviour_, ballBehaviour_, platformBehaviour_,
                                    soundEffectBehaviour_, sceneLoader);
    }
Esempio n. 15
0
 void Start()
 {
     animator       = gameObject.GetComponent <Animator>();
     gm             = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();
     menuSystem     = GameObject.FindGameObjectWithTag("MenuSystem").GetComponent <MenuSystem>();
     StartText      = gameObject.GetComponentInChildren <Text>();
     StartText.text = gm.ReturnSceneNames(SceneManager.GetActiveScene().buildIndex);
 }
Esempio n. 16
0
 public override void Tweak(SpectrumMenu menu)
 {
     menu.TweakAction(Name, () =>
     {
         MenuSystem.ShowMenu(MenuTree, menu, 0);
         base.Tweak(menu);
     }, Description);
 }
Esempio n. 17
0
        /// <summary>
        /// menus
        /// </summary>
        private LoadingScreen(MenuSystem menuSystem, bool loadingIsSlow,
                              GameScreen[] screensToLoad)
        {
            this.loadingIsSlow = loadingIsSlow;
            this.screensToLoad = screensToLoad;

            TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
Esempio n. 18
0
    void DrawOptions()
    {
        MenuSystem.BeginMenu("Options");

        MenuSystem.Button("Draw Distance: " + CubeWorldPlayerPreferences.farClipPlanes[CubeWorldPlayerPreferences.viewDistance], delegate()
        {
            CubeWorldPlayerPreferences.viewDistance = (CubeWorldPlayerPreferences.viewDistance + 1) % CubeWorldPlayerPreferences.farClipPlanes.Length;

            if (gameManagerUnity.playerUnity)
            {
                gameManagerUnity.playerUnity.mainCamera.farClipPlane = CubeWorldPlayerPreferences.farClipPlanes[CubeWorldPlayerPreferences.viewDistance];
            }
        }
                          );

        MenuSystem.Button("Show Help: " + CubeWorldPlayerPreferences.showHelp, delegate()
        {
            CubeWorldPlayerPreferences.showHelp = !CubeWorldPlayerPreferences.showHelp;
        }
                          );

        MenuSystem.Button("Show FPS: " + CubeWorldPlayerPreferences.showFPS, delegate()
        {
            CubeWorldPlayerPreferences.showFPS = !CubeWorldPlayerPreferences.showFPS;
        }
                          );

        MenuSystem.Button("Show Engine Stats: " + CubeWorldPlayerPreferences.showEngineStats, delegate()
        {
            CubeWorldPlayerPreferences.showEngineStats = !CubeWorldPlayerPreferences.showEngineStats;
        }
                          );

        MenuSystem.Button("Visible Strategy: " + System.Enum.GetName(typeof(SectorManagerUnity.VisibleStrategy), CubeWorldPlayerPreferences.visibleStrategy), delegate()
        {
            if (System.Enum.IsDefined(typeof(SectorManagerUnity.VisibleStrategy), (int)CubeWorldPlayerPreferences.visibleStrategy + 1))
            {
                CubeWorldPlayerPreferences.visibleStrategy = CubeWorldPlayerPreferences.visibleStrategy + 1;
            }
            else
            {
                CubeWorldPlayerPreferences.visibleStrategy = 0;
            }
        }
                          );

        MenuSystem.LastButton("Back", delegate()
        {
            CubeWorldPlayerPreferences.StorePreferences();

            gameManagerUnity.PreferencesUpdated();

            state = MainMenuState.NORMAL;
        }
                              );

        MenuSystem.EndMenu();
    }
Esempio n. 19
0
    void Start()
    {
        anim       = gameObject.GetComponent <Animator>();
        menuSystem = transform.root.GetComponent <MenuSystem>();
        gm         = GameObject.FindGameObjectWithTag("GM").GetComponent <GameMaster>();

        introText      = gameObject.GetComponentInChildren <Text>();
        introText.text = gm.ReturnSceneIntroText(gm.levelToLoad);
    }
Esempio n. 20
0
        static void Postfix(GeneralMenu __instance)
        {
            MenuSystem.MenuBlueprint = __instance.menuBlueprint_;

            __instance.TweakAction("CONFIGURE SPECTRUM PLUGINS", () =>
            {
                MenuSystem.ShowMenu(MenuSystem.MenuTree, __instance, 0);
            });
        }
Esempio n. 21
0
 public void BackClick()
 {
     if (hideDelay <= 0 && MenuSystem.CustomCanInvoke(checkMenuState: false, checkNetworkState: false) && onBack != null)
     {
         Action action = onBack;
         Hide(backHideDelay);
         action();
     }
 }
Esempio n. 22
0
 private void Start()
 {
     if (Advertisement.isSupported)
     {
         Advertisement.Initialize(gameId, testMode);
         Advertisement.AddListener(this);
         ms = FindObjectOfType <MenuSystem>();
     }
 }
Esempio n. 23
0
    void Awake()
    {
        _globalConfig = GlobalConfig.Load(ConfigFileName);
        _menuSystem   = GetComponent <MenuSystem>();
        _menuSystem.Init(this);

        GameContainer.GameEnded += EnterPostGame;
        GameContainer.Init(this, _globalConfig.GameConfig);
    }
Esempio n. 24
0
	private void OnDestroy ()
	{
		dialog = null;
		playerInput = null;
		playerInteraction = null;
		menuSystem = null;
		stateHandler = null;
		options = null;
		settingsManager = null;
	}
Esempio n. 25
0
        public GameForm()
        {
            InitializeComponent();

            MenuSystem menu = new MenuSystem();

            //Main Menu
            Menu main = new Menu("Main Menu", null,
                                 new MenuItem("Play Game", () => Console.WriteLine("Play")),
                                 new MenuItem("Load Game", () => menu.PrintMenu("Load Menu")),
                                 new MenuItem("Options", () => menu.PrintMenu("Options Menu")),
                                 new MenuItem("Quit", () => Environment.Exit(0))
                                 );

            //Load Menu
            Menu load = new Menu("Load Menu", main,
                                 new MenuItem("Slot 1", () => Console.WriteLine("Slot 1")),
                                 new MenuItem("Slot 2", () => Console.WriteLine("Slot 2")),
                                 new MenuItem("Back to Main Menu", () => menu.PrintMenu("Main Menu"))
                                 );

            //Options Menu
            Menu options = new Menu("Options Menu", main,
                                    new MenuItem("Graphics", () => Console.WriteLine("Resolution: XxX")),
                                    new MenuItem("Key bindings", () => Console.WriteLine("Bindings")),
                                    new MenuItem("Back to Main Menu", () => menu.PrintMenu("Main Menu"))
                                    );

            //Add Menus to MenuSystem
            menu.AddMenu(main);
            menu.AddMenu(load);
            menu.AddMenu(options);

            //Subscribe to Event to allow the menus to be printed
            menu.Print += (object sender, MenuEventArgs e) =>
            {
                pnlMenu.Controls.Clear();

                foreach (var item in e.Menu.Items)
                {
                    var btn = new System.Windows.Forms.Button()
                    {
                        Text  = item.Name,
                        Width = this.Width - 20
                    };

                    btn.Click += (objSender, args) => item.Action();

                    pnlMenu.Controls.Add(btn);
                }
            };

            //Print Main Menu to start
            menu.PrintMenu("Main Menu");
        }
Esempio n. 26
0
 void Start()
 {
     // currently am not using any animation, but there is a side arrow button animator;
     //animator = gameObject.GetComponent<Animator>();
     menuSystem   = GameObject.FindGameObjectWithTag("MenuSystem").GetComponent <MenuSystem>();
     audioManager = GameObject.FindGameObjectWithTag("AudioManager").GetComponent <AudioManager>();
     if (player == null)
     {
         FindPlayer();
     }
 }
Esempio n. 27
0
 public void PlayLevel()
 {
     menuSystem = FindObjectOfType <MenuSystem>();
     if (menuSystem.chosenLevel != "")
     {
         SceneManager.LoadScene(menuSystem.chosenLevel);
     }
     else
     {
     }
 }
Esempio n. 28
0
    void DrawMenuAbout()
    {
        MenuSystem.BeginMenu("Author");

        GUI.TextArea(new Rect(10, 40 + 30 * 0, 380, 260),
                     "Work In Progress by Federico D'Angelo ([email protected])");

        MenuSystem.LastButton("Back", delegate() { state = MainMenuState.NORMAL; });

        MenuSystem.EndMenu();
    }
Esempio n. 29
0
        /// <summary>
        /// Loads Levels
        /// </summary>
        public static void Load(MenuSystem MenuSystem, bool loadingIsSlow, string levelName)
        {
            // Tell all the current screens to transition off.
            MenuSystem.ExitAll();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen(MenuSystem,
                                                            loadingIsSlow,
                                                            levelName);
            MenuSystem.AddScreen(loadingScreen);
        }
Esempio n. 30
0
    private void UntimedActionCompleted(int entityID, RPGGameEvent actionType)
    {
        MenuSystem.ClearOptions(entityID);

        var action = this.EntityManager.GetComponent <ActionComponent>(entityID);

        if (action != null && action.ActionType == RPGGameEvent.FallStarted)
        {
            action.ActionType = RPGGameEvent.None;
        }
    }
 public void Start(MenuSystem pointer)
 {
     forButtons = new changeIndex(ChangeIndex);
     index      = initialIndex;
     Buttons[index].Select();
     for (int i = 0; i < Buttons.Length; i++)
     {
         Buttons[i].Start(i, UpdateToggles, forButtons);
     }
     UpdateVisuals();
     systemPointer = pointer;
 }
Esempio n. 32
0
        private void Awake()
        {
            _menuContext = MenuContext.GetMenuContext();
            _services    = UsableServices.SharedInstance;
            _services.Initialize(_menuContext);

            _setupSystem = new SetupSystem(_menuContext, _services);
            _menuSystem  = new MenuSystem(_menuContext, _services, log);

            _setupSystem.Awake();
            _menuSystem.Awake();
        }
Esempio n. 33
0
	private void Awake ()
	{
		if (AdvGame.GetReferences () && AdvGame.GetReferences ().settingsManager)
		{
			settingsManager = AdvGame.GetReferences ().settingsManager;
		}
		
		playerInput = this.GetComponent <PlayerInput>();
		playerInteraction = this.GetComponent <PlayerInteraction>();
		menuSystem = this.GetComponent<MenuSystem>();
		dialog = this.GetComponent<Dialog>();
	}
Esempio n. 34
0
        /// <summary>
        /// Loads Menus.
        /// </summary>
        public static void Load(MenuSystem MenuSystem, bool loadingIsSlow, params GameScreen[] screensToLoad)
        {
            // Tell all the current screens to transition off.
            foreach (GameScreen screen in MenuSystem.GetScreens())
                screen.ExitScreen();

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen(MenuSystem,
                                                            loadingIsSlow,
                                                            screensToLoad);

            MenuSystem.AddScreen(loadingScreen);
        }
Esempio n. 35
0
    public virtual void Initialize(MenuSystem menuSystem)
    {
        m_pMenuSystem = menuSystem;

        MenuButton[] buttons = gameObject.GetComponentsInChildren<MenuButton>();
        for (int i = 0; i < buttons.Length; i++) {
            if( buttons[i].m_bSubMenuButton == false )
                buttons[i].Initialize(ButtonClicked);
        }

        SubMenuBase[] subMenus = gameObject.GetComponentsInChildren<SubMenuBase>();
        for (int i = 0; i < subMenus.Length; i++) {
            subMenus[i].Initialize(this);
        }
    }
Esempio n. 36
0
 public override void Initialize(MenuSystem menuSystem)
 {
     base.Initialize (menuSystem);
 }