Inheritance: MonoBehaviour
Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ScanDirTree(Environment.GetFolderPath(Environment.SpecialFolder.Programs));

            return;


            Template t = TemplateParser.Parse("Template.ini");

            List <string> startMenus = new List <string>(2)
            {
                Environment.GetFolderPath(Environment.SpecialFolder.Programs),
                @"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\"
            };

            HashSet <string> knownCategories = new HashSet <string>
            {
                "Research In Motion",
                "Accessories",
                "Accessories\\System Tools"
            };

            foreach (var templateCategory in t)
            {
                knownCategories.Add(templateCategory.Name);
            }


            StartMenu menu = new StartMenu();

            menu.KnownCategories = knownCategories;
            menu.AddLocations(startMenus);

            var commands = new List <Command>(t.TransformStartMenu(menu));

            Console.WriteLine(new string('-', 80));
            Console.WriteLine(menu);

            foreach (var cmd in commands)
            {
                Console.WriteLine(cmd);
                cmd.Execute();
            }


            Console.WriteLine(new string('-', 80));
            Console.WriteLine(menu);

            commands.Reverse();
            foreach (var cmd in commands)
            {
                Console.WriteLine(cmd);
                cmd.UnExecute();
            }

            Console.WriteLine(new string('-', 80));
            Console.WriteLine(menu);

            //Console.ReadLine();
        }
Ejemplo n.º 2
0
    private void Start()
    {
        m_commsPanel       = GetComponentInChildren <CommsPanel>();
        m_securityPanel    = GetComponentInChildren <SecurityPanel>();
        m_engineeringPanel = GetComponentInChildren <EngineeringPanel>();
        m_flightPanel      = transform.GetChild(2).GetComponentInChildren <MapLogic>();
        m_startPanel       = transform.GetComponentInChildren <StartMenu>();


        comsObj         = transform.GetChild(1).gameObject;
        secObj          = transform.GetChild(3).gameObject;
        engObj          = transform.GetChild(0).gameObject;
        flightObj       = transform.GetChild(2).gameObject;
        startMenuObj    = transform.GetChild(4).gameObject;
        gameOverMenuObj = transform.GetChild(5).gameObject;
        gameWonObj      = transform.GetChild(6).gameObject;


        CloseComs();
        CloseSecurity();
        CloseEng();
        CloseFlight();
        CloseStart();
        CloseGameOver();
        CloseGameWon();
        OpenStart();
        //GameStateManager.Instance.TargetState = GAME_STATE.Flight;
    }
Ejemplo n.º 3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            base.Initialize();
            IsMouseVisible = true;

            // Create and load space objects
            int xPos = DrawingConstants.X_BOARD_BUFFER;

            // Add space size added to account for blue arrow
            int yPos = DrawingConstants.Y_BOARD_BUFFER + DrawingConstants.SPACE_SIZE;

            for (int col = 0; col < NUM_COLUMNS; col++)
            {
                _boardColumns[col] = new BoardColumn(
                    xPos,
                    yPos,
                    _imageDict[ImageNames.COLUMN_HOLDER],
                    _imageDict[ImageNames.HIGHLIGHTED_COLUMN_HOLDER],
                    _imageDict[ImageNames.BLUE_ARROW]);

                // Move to next column.
                xPos += DrawingConstants.SPACE_SIZE;
            }

            CurrentMenu = MenuState.Start;
            _winner     = DiscColor.None;

            _startMenu     = new StartMenu(_consolas24);
            _playAgainMenu = new PlayAgainMenu(_consolas24, GraphicsDevice);

            ResetGame();
        }
Ejemplo n.º 4
0
 public CherryGame()
 {
     this.graphics = new GraphicsDeviceManager(this);
     this.Content.RootDirectory = "Content";
     this.gameObjects           = new List <IDrawableGameObject>();
     this.startMenu             = new StartMenu();
 }
Ejemplo n.º 5
0
        private void InitializeComponent()
        {
            var viewmodel = new StartMenuViewModel();
            var view      = new StartMenu(viewmodel);

            view.Show();
        }
Ejemplo n.º 6
0
        protected override void Initialize()
        {
            EventHandler eventStartStart = onStart;
            EventHandler eventExitStart  = OnExit;

            startMenu = new StartMenu(this, ref eventStartStart, ref eventExitStart);
            this.Components.Add(startMenu);

            EventHandler eventExitPause     = OnExitPause;
            EventHandler eventContinuePause = OnContinue;

            pauseMenu = new PauseMenu(this, ref eventExitPause, ref eventContinuePause);
            this.pauseMenu.Enabled = false;
            this.pauseMenu.Visible = false;
            this.Components.Add(pauseMenu);

            Window.AllowUserResizing = true;

            base.Initialize();

            UpdateSize();

            Window.ClientSizeChanged += (object sender, EventArgs e) =>
            {
                //map.GenerateMap(Window);
                UpdateSize();
            };
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Looks through all the categories in <paramref name="startMenu"/> and returns
        /// <see cref="DeleteFileCommand"/> commands for one that are empty.
        /// </summary>
        /// <remarks>
        /// This method should be called after the actual files in the start menu has been transformed.
        /// Applying the commands generated by this method should not invalidate the <paramref name="startMenu"/>,
        /// but it is not guaranteed.
        /// </remarks>
        /// <param name="startMenu">The <see cref="StartMenu"/> to cleanup.</param>
        /// <returns>A list of commands that can be applied to cleanup the <paramref name="startMenu"/></returns>
        public IEnumerable <Command> CleanupStartMenu(StartMenu startMenu)
        {
            // Look through all existing program categories.
            foreach (var programCategory in startMenu.Where(p => p.RealLocations.Count() > 0))
            {
                int count = programCategory.RealLocations.Sum(
                    l => Directory.GetFiles(l).Length + Directory.GetDirectories(l).Length
                    );

                if (count == 0)
                {
                    yield return(new DeleteFileCommand(programCategory.RealLocations));
                }
            }

            // Look though all restricted categories
            foreach (var programCategory in this.Where(c => c.IsRestricted)
                     .Select(c => new ProgramCategory(startMenu, c.RestrictedPath)))
            {
                if (programCategory.RealLocations.Count() == 0)
                {
                    continue;
                }

                int count = programCategory.RealLocations.Sum(
                    l => Directory.GetFiles(l).Length + Directory.GetDirectories(l).Length
                    );

                if (count == 0)
                {
                    yield return(new DeleteFileCommand(programCategory.RealLocations));
                }
            }
        }
Ejemplo n.º 8
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetButton("Cancel"))
     {
         StartMenu.RestartGame();
     }
 }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            StartMenu title = new StartMenu();

            title.TitleName();
            Console.ReadLine();
        }
Ejemplo n.º 10
0
        static void PrintIfMore()
        {
            Console.WriteLine("\n\tPrint num if more by previor\n\n");
            Random rand = new Random();

            int[] arr = new int[10];
            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = rand.Next(-10, 10);
            }
            Kiselev_Andrey.Array.Print(arr, "Array:");

            List <int> res = new List <int>();

            for (int i = 1; i < arr.Length; i++)
            {
                if (arr[i] > arr[i - 1])
                {
                    res.Add(arr[i]);
                }
            }

            Console.WriteLine("\nResult:");
            foreach (var item in res)
            {
                Matrix.IntPrintBeautiful(item);
            }
            StartMenu.EnterClearConsole();
        }
Ejemplo n.º 11
0
        public void ProgramItemSortComparison()
        {
            Directory.CreateDirectory("Empty");
            StartMenu       s   = new StartMenu("Empty");
            ProgramCategory cat = new ProgramCategory(s);
            var             l   = new List <ProgramItem>
            {
                new ProgramItem(cat, "Z.lnk"),
                new ProgramItem(cat, "2.lnk"),
                new ProgramItem(cat, "B.lnk"),
                new ProgramItem(cat, "1.lnk"),
                new ProgramItem(cat, "A.lnk"),
            };

            var lSorted = new List <ProgramItem>
            {
                new ProgramItem(cat, "1.lnk"),
                new ProgramItem(cat, "2.lnk"),
                new ProgramItem(cat, "A.lnk"),
                new ProgramItem(cat, "B.lnk"),
                new ProgramItem(cat, "Z.lnk"),
            };

            Assert.IsFalse(l.SequenceEqual(lSorted));
            l.Sort();
            Assert.IsTrue(l.SequenceEqual(lSorted));
        }
Ejemplo n.º 12
0
        static void Fibonachy()
        {
            Console.WriteLine("\n\tFibonachy\n\n");
            int num = ConsoleRead.Int("Imput count elements: ");

            int[] fibonachi = new int[num];
            for (int i = 0; i < num; i++)
            {
                int k = i - 2;
                if (k < 0)
                {
                    fibonachi[i] = i;
                }
                else
                {
                    fibonachi[i] = fibonachi[i - 1] + fibonachi[k];
                }
            }
            Console.WriteLine($"\nFibonachi array:\n");
            for (int i = 0; i < num; i++)
            {
                Console.Write(fibonachi[i] + " ");
            }
            StartMenu.EnterClearConsole();
        }
Ejemplo n.º 13
0
        static void Progressions()
        {
            Console.WriteLine("\n\tArithmetic and Geometric progression\n\n");

            int startNum  = ConsoleRead.Int("Input start num: ");
            int increment = ConsoleRead.Int("Input increment: ");
            int countNum  = ConsoleRead.Int("Input number of elements: ");

            int[] arrA = new int[countNum];
            int[] arrG = new int[countNum];

            arrA[0] = startNum;
            arrG[0] = startNum;

            for (int i = 1; i < countNum; i++)
            {
                arrA[i] = arrA[i - 1] + increment;
                arrG[i] = arrG[i - 1] * increment;
            }

            Kiselev_Andrey.Array.Print(arrA, "Arithmetic progression:");
            Kiselev_Andrey.Array.Print(arrG, "Geometric progression:");

            StartMenu.EnterClearConsole();
        }
Ejemplo n.º 14
0
        private void button3_Click(object sender, EventArgs e)
        {
            StartMenu s = new StartMenu();

            s.Show();
            this.Close();
        }
Ejemplo n.º 15
0
    private IEnumerator CallAdvent()
    {
        Music.PlaySE(Music.Clip.Enter);
        StartMenu.OnAfterEnter();
        yield return(new WaitForSeconds(3));

        switch (buttonNum)
        {
        case 0:
            Advent.StartAdventure(-1, 1);
            break;

        case 1:
            Advent.StartAdventure(0, 1);
            break;

        case 2:
            Advent.StartAdventure(1, 1);
            break;

        case 3:
            Advent.StartAdventure(2, 1);
            break;
        }
    }
Ejemplo n.º 16
0
        public static void Main()
        {
            var printStartMenu = new StartMenu();

            var keyboard = new UserInterfacecs();

            StarCraftEngine engine = new StarCraftEngine(new Player("a", RaceType.Protoss, Position.Parse("1,1")),
                                                         new Player("b", RaceType.Zerg, Position.Parse("2,2")),
                                                         keyboard);

            // Event. listen for enter kay press
            keyboard.OnActionPressed += (sender, eventInfo) =>
            {
                Console.Write("Enter command: ");
                string input = Console.ReadLine();
                if (!string.IsNullOrEmpty(input))
                {
                    engine.ParceCommand(input);
                }

                // Console.Clear();
            };

            engine.InitialiseGame();
            // Start engine
            engine.Run();
        }
Ejemplo n.º 17
0
 void InitSubMenus()
 {
     _startMenu   = gameObject.GetComponent <StartMenu> ();
     _pauseMenu   = gameObject.GetComponent <PauseMenu> ();
     _optionsMenu = gameObject.GetComponent <OptionsMenu> ();
     _statsMenu   = gameObject.GetComponent <StatsMenu> ();
     _creditMenu  = gameObject.GetComponent <CreditsMenu> ();
 }
Ejemplo n.º 18
0
 void BackTask()
 {
     StartMenu.SetActive(true);
     ExitButton.gameObject.SetActive(true);
     BackButton.gameObject.SetActive(false);
     ActiveGame.SetActive(false);
     Animate = true;
 }
Ejemplo n.º 19
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (StartMenu.CheckAfterEnter())
     {
         return;
     }
     StartMenu.BackMenu();
 }
        //Exit button
        private void btnReturn_Click(object sender, EventArgs e)
        {
            //This section closes all the forms and exit the game by clicking in X on the Windows form
            StartMenu startMenu = new StartMenu();

            startMenu.Show();
            Hide();
        }
Ejemplo n.º 21
0
 // Use this for initialization
 void Start()
 {
     Instance = this;
     GameData.Initialize();
     Player.Initialize();
     LoadSavedGames();
     Mod.LoadAllMods();
 }
Ejemplo n.º 22
0
 private void Awake()
 {
     if (Instance != null)
     {
         Destroy(Instance);
     }
     Instance = this;
 }
Ejemplo n.º 23
0
 //Initializing the Manager by populating the menus
 //Also sets up the starting state and initializes the In Game Menu
 public void Init()
 {
     StartMenu  = (StartMenu)MenuDictionary[MenuState.StartMenu.ToString()];
     InGameMenu = (InGameMenu)MenuDictionary[MenuState.InGameMenu.ToString()];
     ResultMenu = (ResultMenu)MenuDictionary[MenuState.ResultMenu.ToString()];
     SetState(MenuState.StartMenu);
     InGameMenu.Init();
 }
Ejemplo n.º 24
0
 public void OnPointerExit(PointerEventData eventData)
 {
     if (StartMenu.CheckAfterEnter())
     {
         return;
     }
     ChangeColor(0);
 }
Ejemplo n.º 25
0
        public void StandardRun()
        {
            var knownCategories = new HashSet <string>(StringComparer.OrdinalIgnoreCase);

            ExtractZip("Programs.System.zip", "Programs.System");
            ExtractZip("Programs.User.zip", "Programs.User");

            knownCategories.Add("Accessories");
            knownCategories.Add("Administrative Tools");

            var startMenu = new StartMenu(knownCategories, "Programs.System", "Programs.User");

            Template t = TemplateParser.Parse("TransformationTest.Setup.ini");

            foreach (var templateCategory in t)
            {
                knownCategories.Add(templateCategory.Name);
            }

            startMenu.Refresh();

            List <Command> realCommand      = new List <Command>();
            List <Command> rollbackCommands = new List <Command>();

            var list = t.TransformStartMenu(startMenu).ToList();

            foreach (var command in list)
            {
                command.Execute();
                realCommand.Add((command as MoveProgramItemCommand).GetIoCommand());
            }

            foreach (var command in realCommand)
            {
                command.Execute();
                rollbackCommands.Add((command as MoveFileCommand).GetReverseCommand());
                Console.WriteLine(command);
            }

            var obj =
                new CommandGroup()
            {
                Name     = string.Format("Actions performed on {0} {1}", DateTime.UtcNow.ToLongDateString(), DateTime.UtcNow.ToLongTimeString()),
                Commands = rollbackCommands
            };

            var cleanupCommands = t.CleanupStartMenu(startMenu).ToList();

            foreach (var cleanupCommand in cleanupCommands)
            {
                Console.WriteLine(cleanupCommand);
                cleanupCommand.Execute();

                obj.Commands.Add(((MoveFileCommand)cleanupCommand).GetReverseCommand());
            }

            File.WriteAllText("rollback.json", fastJSON.JSON.Instance.ToJSON(obj, true, true));
        }
Ejemplo n.º 26
0
    void Awake()
    {
        startMenu      = StartMenu.Instance();
        displayManager = DisplayManager.Instance();

        startAction = new UnityAction(StartFunction);
        aboutAction = new UnityAction(AboutFunction);
        StartThings();
    }
Ejemplo n.º 27
0
 public void OnPointerEnter(PointerEventData eventData)
 {
     if (StartMenu.CheckAfterEnter())
     {
         return;
     }
     Music.PlaySE(Music.Clip.Dun);
     ChangeColor(1);
 }
Ejemplo n.º 28
0
    public static void InitialiseCount(LeapInterface leap, GestureSpace space, StartMenu menu)
    {
        // Create gesture detector
        CountDetector count = new CountDetector(leap, space);

        // Register regions of interest
        ActivityROIs.ConnectROIs(count);
        count.RegisterObserver(menu);
    }
Ejemplo n.º 29
0
        public void StartMenuTestInput()
        {
            StartMenu startmenu = new StartMenu();
            Game      game      = new Game(startmenu);

            game.Turn(ConsoleKey.LeftArrow);

            Assert.AreEqual(startmenu.key, ConsoleKey.LeftArrow);
        }
Ejemplo n.º 30
0
        private void Fuck_Load(object sender, EventArgs e)
        {
            StartMenu s = new StartMenu();

            s.Show();
            this.Opacity = 0.0f;

            this.ShowInTaskbar = false;
        }
Ejemplo n.º 31
0
        private void FinishCreatingTestBtn_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show($"Test{_testTitle} has been added", "Test", MessageBoxButton.OK, MessageBoxImage.Information);
            StartMenu instance     = Application.Current.Windows.OfType <StartMenu>().FirstOrDefault();
            StartMenu new_instance = new StartMenu(instance.UA);

            instance.Close();
            new_instance.Show();
        }
Ejemplo n.º 32
0
    /**---------------------------------------------------------------------------------
     * Should only be executed once.
     * Loads all components necessary for the script.
     * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call.
     */
    public void LoadComponents()
    {
        startMenuGameObj            = GameObject.Find("StartMenu_Canvas");
        helpMenuGameObj             = GameObject.Find("HelpMenu_Canvas");
        backGameObj                 = GameObject.Find("HelpBack_TextBtn");

        startMenuObj                = startMenuGameObj.GetComponent<StartMenu>();

        startMenu                   = startMenuGameObj.GetComponent<Canvas>();
        helpMenu                    = helpMenuGameObj.GetComponent<Canvas>();
        backText                    = backGameObj.GetComponent<Button>();
    }
Ejemplo n.º 33
0
    /**---------------------------------------------------------------------------------
     * Should only be executed once.
     * Loads necessary components for Twitter menu.
     * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call.
     */
    public void LoadCompononents()
    {
        startMenuGameObject             = GameObject.Find("StartMenu_Canvas");
        twitterMenuGameObject           = GameObject.Find("TwitterMenu_Canvas");
        backGameObject                  = GameObject.Find("TwitterBack_TextBtn");

        startMenuObject                 = startMenuGameObject.GetComponent<StartMenu>();

        twitterMenu                     = twitterMenuGameObject.GetComponent<Canvas>();
        startMenu                       = startMenuGameObject.GetComponent<Canvas>();
        backText                        = backGameObject.GetComponent<Button>();
    }
Ejemplo n.º 34
0
    static void Main(string[] args)
    {
        StartMenu menu = new StartMenu();
        LeapInterface leap = new LeapInterface();
        GestureSpace space = new GestureSpace();

        InitialiseCount(leap, space, menu);

        Console.ReadLine();

        leap.Stop();
        leap.Destroy();
    }
Ejemplo n.º 35
0
    void Awake()
    {
        if (menu == null)
        {
            menu = this;
            DontDestroyOnLoad(menu);
        }
        else if (menu != this)
        {
            Destroy(menu.gameObject);
            WorldParen.SetActive(false);
            Loose.SetActive(true);
            menu = this;
            DontDestroyOnLoad(menu);
            StartLevel.GetComponent<Image>().sprite = TryAgain;
            MenuButton.SetActive(true);

        }
    }
Ejemplo n.º 36
0
    void Start()
    {
        exitButton = exitButton.GetComponent<Button>();
        menuCanvas = menuCanvas.GetComponent<Canvas>();
        uiCanvas = uiCanvas.GetComponent<Canvas>();
        gamePausedCanvas = gamePausedCanvas.GetComponent<Canvas>();
        playButton = playButton.GetComponent<Button>();
        continueButton = continueButton.GetComponent<Button>();
        continueText = continueText.GetComponent<Text>();
        playText = playText.GetComponent<Text>();

        snakeObject = GameObject.FindGameObjectWithTag("Snake");
        snakeScript = snakeObject.GetComponent<Snake>();
        backgroundObject = GameObject.FindGameObjectWithTag("Background");
        addPortalScript = backgroundObject.GetComponent<AddPortal>();
        GameObject startmenu = GameObject.FindGameObjectWithTag("Startmenu");
        startMenuScript = startmenu.GetComponent<StartMenu>();

        uiCanvas.enabled = false;
    }
Ejemplo n.º 37
0
 // Use this for initialization
 void Start()
 {
     GameController.turnoffUIs();
     Menu = new StartMenu();
     Menu.open(true,true,false);
 }
Ejemplo n.º 38
0
        public void ProgramItemSortComparison()
        {
            Directory.CreateDirectory("Empty");
            StartMenu s = new StartMenu("Empty");
            ProgramCategory cat = new ProgramCategory(s);
            var l = new List<ProgramItem>
                                   {
                                       new ProgramItem(cat, "Z.lnk"),
                                       new ProgramItem(cat, "2.lnk"),
                                       new ProgramItem(cat, "B.lnk"),
                                       new ProgramItem(cat, "1.lnk"),
                                       new ProgramItem(cat, "A.lnk"),
                                   };

            var lSorted = new List<ProgramItem>
                                   {
                                       new ProgramItem(cat, "1.lnk"),
                                       new ProgramItem(cat, "2.lnk"),
                                       new ProgramItem(cat, "A.lnk"),
                                       new ProgramItem(cat, "B.lnk"),
                                       new ProgramItem(cat, "Z.lnk"),
                                   };

            Assert.IsFalse(l.SequenceEqual(lSorted));
            l.Sort();
            Assert.IsTrue(l.SequenceEqual(lSorted));
        }
Ejemplo n.º 39
0
        public void ProgramItemEquality()
        {
            Directory.CreateDirectory("Empty");
            StartMenu s = new StartMenu("Empty");
            ProgramCategory cat = new ProgramCategory(s);
            ProgramItem a = new ProgramItem(cat, "Hello.lnk");
            ProgramItem b = new ProgramItem(cat, "Hello.lnk");

            Assert.IsTrue(a == b, "Equality operator failed");
            Assert.AreEqual(true, a.Equals(b), "Explicit call to IEquatable<T> method failed");
            Assert.AreEqual(a, b, "Generic Assert.AreEqual call failed");
        }
Ejemplo n.º 40
0
    /**---------------------------------------------------------------------------------
     * Should only be executed once.
     * Loads necessary components for Load Level menu.
     * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call.
     */
    public void LoadComponents()
    {
        startMenuGameObject             = GameObject.Find("StartMenu_Canvas");
        loadMenuGameObject              = GameObject.Find("LoadLevelMenu_Canvas");
        backGameObject                  = GameObject.Find("LoadLevelBack_TextBtn");

        startMenuObject                 = startMenuGameObject.GetComponent<StartMenu>();

        startMenu                       = startMenuGameObject.GetComponent<Canvas>();
        loadLevelMenu                   = loadMenuGameObject.GetComponent<Canvas>();
        backText                        = backGameObject.GetComponent<Button>();
    }
Ejemplo n.º 41
0
    /**---------------------------------------------------------------------------------
     * Should only be executed once.
     * Loads all components necessary for the script.
     * Changing the name of a GameObject in the scene will require changing the string in the respective GameObject.Find() call.
     * Loads audio settings from GlobalGameSettings.
     */
    public void LoadComponents()
    {
        GlobalGameSettings.LoadSettings();
        startMenuGameObject             = GameObject.Find("StartMenu_Canvas");
        optionsMenuGameObject           = GameObject.Find("OptionsMenu_Canvas");
        backGameObject                  = GameObject.Find("OptionsBack_TextBtn");
        masterVolGameObject             = GameObject.Find("SoundMaster_Slider");
        masterVolText                   = GameObject.Find("SoundMasterCounter_Text").GetComponent<Text>();
        musicVolGameObject              = GameObject.Find("SoundMusic_Slider");
        musicVolText                    = GameObject.Find("SoundMusicCounter_Text").GetComponent<Text>();
        effectsVolGameObject            = GameObject.Find("SoundEffects_Slider");
        effectsVolText                  = GameObject.Find("SoundEffectsCounter_Text").GetComponent<Text>();

        startMenu                       = startMenuGameObject.GetComponent<Canvas>();
        optionsMenu                     = optionsMenuGameObject.GetComponent<Canvas>();

        startMenuObj                    = startMenuGameObject.GetComponent<StartMenu>();

        backText                        = backGameObject.GetComponent<Button>();
        masterVolSlider                 = masterVolGameObject.GetComponent<Slider>();
        effectsVolSlider                = effectsVolGameObject.GetComponent<Slider>();
        musicVolSlider                  = musicVolGameObject.GetComponent<Slider>();

        int masterVol                   = GlobalGameSettings.GetMasterVolume();
        int effectsVol                  = GlobalGameSettings.GetEffectsVolume();
        int musicVol                    = GlobalGameSettings.GetMusicVolume();

        masterVolSlider.value           = masterVol;
        effectsVolSlider.value          = effectsVol;
        musicVolSlider.value            = musicVol;

        masterVolText.text              = masterVol.ToString();
        effectsVolText.text             = effectsVol.ToString();
        musicVolText.text               = musicVol.ToString();
    }
Ejemplo n.º 42
0
        //Debug
        //private PointerNode _pointer = new PointerNode(PointerRole.Controller);


        #endregion

        #region Constructor
        /// <summary>
        /// Disables the UI and runs the Login procedure
        /// </summary>
        public ActivityBar()
        {
            _startupDesktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            InitializeComponent();
            _activityWindow = new ActivityWindow(this);
            _popUpWindows.Add(_activityWindow);
            _managerWindow = new ManagerWindow(this);
            _popUpWindows.Add(_managerWindow);
            _startMenu = new StartMenu(this);
            _popUpWindows.Add(_startMenu);
            _deviceWindow = new DeviceWindow(this);
            _popUpWindows.Add(_deviceWindow);

            //MouseHook.Register();
            //MouseHook.MouseDown += MouseHookMouseClick;
            //MouseHook.MouseMove += MouseHookMouseMove;

            DisableUi();

            _login = new LoginWindow();
            _login.LoggedIn += LoginLoggedIn;
            _login.Show();
        }