// Use this for initialization
    void Start()
    {
        controllerManagerInstance = NewControllerManager.instance;

        fModConfirmLevelEvent     = FMODUnity.RuntimeManager.CreateInstance(confirmLevelSound);
        fModLevelInteractionEvent = FMODUnity.RuntimeManager.CreateInstance(levelInteractionSound);

        // Get a referecne to the pause menu so that it can be disabled when players try to laod a level
        if (InteractiveMenu.instance != null)
        {
            interactiveMenuSingleton = InteractiveMenu.instance;
        }
        if (SaveManager.instance)
        {
            if (SaveManager.instance.save.levelByName[sceneName] != null)
            {
                levelSaveFile = SaveManager.instance.save.levelByName[sceneName];
            }
            else
            {
                print(sceneName);
            }
        }
        // Update the level information displayed if a level is completed
        UpdateLevelInformation();
    }
Exemple #2
0
    // Use this for initialization
    void Start()
    {
        // Get all of the sitting spots in the
        foreach (Transform child in transform)
        {
            if (child.gameObject.tag == "SittingSpot")
            {
                sittingSpots.Add(child);
            }

            // Randomize the sitting spots order
            for (int i = 0; i < sittingSpots.Count; i++)
            {
                Transform temp         = sittingSpots[i];
                int       randomeIndex = Random.Range(i, sittingSpots.Count);
                sittingSpots[i]            = sittingSpots[randomeIndex];
                sittingSpots[randomeIndex] = temp;
            }
        }

        // Set up the other objects in the scene
        if (buttonPromptText.activeSelf == true)
        {
            buttonPromptText.SetActive(false);
        }

        movingCameraScript = Camera.main.GetComponent <MovingCamera>();

        // Get a referecne to the pause menu so that it can be disabled when players try to laod a level
        if (InteractiveMenu.instance != null)
        {
            interactiveMenuSingleton = InteractiveMenu.instance;
        }

        controllerManagerInstance = NewControllerManager.instance;

        // Create the Audio Events
        fModLevelCompleteEvent    = FMODUnity.RuntimeManager.CreateInstance(confirmLevelSound);
        fModLevelInteractionEvent = FMODUnity.RuntimeManager.CreateInstance(levelInteractionSound);

        foreach (Transform child in Camera.main.transform)
        {
            if (child.name == "Music")
            {
                musicEmitter = child.GetComponent <FMODUnity.StudioEventEmitter>();
            }
        }
    }
        void dataEntry()
        {
            // take numbers from user
            listDataInput();

            Console.Clear();
            int currentButton = 1; // the default button which indicator starts from

            while (true)
            {
                Console.Clear();

                // making the Yes/No side menu
                InteractiveMenu.buttonDrawer(sideMenuButtonTexts, currentButton, ConsoleColor.Red, ConsoleColor.White);

                ConsoleKeyInfo userInput = Console.ReadKey();
                switch (userInput.Key)
                {
                case ConsoleKey.DownArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, sideMenuButtonTexts.Length - 1, currentButton, ConsoleKey.DownArrow);
                    break;

                case ConsoleKey.UpArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, sideMenuButtonTexts.Length - 1, currentButton, ConsoleKey.UpArrow);
                    break;

                case ConsoleKey.Enter:
                    switch (currentButton)
                    {
                    case 1:
                        listDataInput();
                        break;

                    case 2:
                        processClose();
                        return;

                    default:
                        break;
                    }
                    break;;

                default:
                    break;
                }
            }
        }
        public void LoseMenu()
        {
            bool exitLoseMenu  = false;
            int  currentButton = 1;

            while (!exitLoseMenu)
            {
                Console.Clear();

                InteractiveMenu.buttonDrawer(loseMenuTexts, currentButton, ConsoleColor.Red, ConsoleColor.White);

                ConsoleKeyInfo userInput = Console.ReadKey();
                switch (userInput.Key)
                {
                case ConsoleKey.DownArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, loseMenuTexts.Length - 1, currentButton, ConsoleKey.DownArrow);
                    break;

                case ConsoleKey.UpArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, loseMenuTexts.Length - 1, currentButton, ConsoleKey.UpArrow);
                    break;

                case ConsoleKey.Enter:
                    switch (currentButton)
                    {
                    case 1:
                        GameLaunch();
                        break;

                    case 2:
                        exitLoseMenu = true;
                        //MainMenu();
                        break;

                    default:
                        break;
                    }
                    break;

                default:
                    break;
                }
            }
        }
Exemple #5
0
        // main process
        public void ElitePrimeChecker()
        {
            Console.Clear();
            int currentButton = 1;

            while (true)
            {
                Console.Clear();

                InteractiveMenu.buttonDrawer(menuButtonTexts, currentButton, ConsoleColor.Red, ConsoleColor.White);

                ConsoleKeyInfo userInput = Console.ReadKey();
                switch (userInput.Key)
                {
                case ConsoleKey.DownArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, menuButtonTexts.Length - 1, currentButton, ConsoleKey.DownArrow);
                    break;

                case ConsoleKey.UpArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, menuButtonTexts.Length - 1, currentButton, ConsoleKey.UpArrow);
                    break;

                case ConsoleKey.Enter:
                    switch (currentButton)
                    {
                    case 1:
                        primeCheckCalculation();
                        printPrimeNumbers();
                        break;

                    case 2:
                        return;

                    default:
                        break;
                    }
                    break;

                default:
                    break;
                }
            }
        }
Exemple #6
0
        //main procces
        public void ScreenBuffer()
        {
            int currentButton = 1;

            while (true)
            {
                Console.Clear();

                InteractiveMenu.buttonDrawer(menuButtonTexts, currentButton, ConsoleColor.Red, ConsoleColor.White);


                ConsoleKeyInfo userInput = Console.ReadKey();
                switch (userInput.Key)
                {
                case ConsoleKey.DownArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, menuButtonTexts.Length - 1, currentButton, ConsoleKey.DownArrow);
                    break;

                case ConsoleKey.UpArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, menuButtonTexts.Length - 1, currentButton, ConsoleKey.UpArrow);
                    break;

                case ConsoleKey.Enter:
                    switch (currentButton)
                    {
                    case 1:
                        GridDrawer();
                        break;

                    case 2:
                        return;

                    default:
                        break;
                    }
                    break;

                default:
                    break;
                }
            }
        }
Exemple #7
0
        // main process
        static void Main(string[] args)
        {
            if (defaultProgram != 0)
            {
                MainProgram mainProgram = new MainProgram();
                mainProgram.programLoader(defaultProgram);
                return;
            }
            int currentButton = 1;

            while (true)
            {
                Console.Clear();

                InteractiveMenu.buttonDrawer(mainMenuButtonTexts, currentButton, ConsoleColor.Red, ConsoleColor.White);

                ConsoleKeyInfo userInput = Console.ReadKey();
                switch (userInput.Key)
                {
                case ConsoleKey.UpArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, mainMenuButtonTexts.Length - 2, currentButton, ConsoleKey.UpArrow);
                    break;

                case ConsoleKey.DownArrow:
                    currentButton = InteractiveMenu.buttonNavigator(1, mainMenuButtonTexts.Length - 2, currentButton, ConsoleKey.DownArrow);
                    break;

                case ConsoleKey.Enter:
                    MainProgram mainProgram = new MainProgram();
                    mainProgram.programLoader(currentButton);
                    break;

                // quit console application
                case ConsoleKey.Escape:
                    return;

                default:
                    break;
                }
            }
        }
 private void Awake()
 {
     instance = this;
 }
Exemple #9
0
 // Use this for initialization
 void Start()
 {
     animatorComponent        = GetComponent <Animator>();
     interactiveMenuComponent = GetComponentInParent <InteractiveMenu>();
 }
 void Start()
 {
     source      = GameObject.FindWithTag("clickable");     //Finds our single object with the tag clickable (meaning its the object with our interactive script)
     otherScript = source.GetComponent <InteractiveMenu>(); //Sets our otherScript to be the interactive script of the source object
 }
        public void ProgramStart()
        {
            while (true)
            {
                Console.Clear();

                // when there are still no posts
                while (posts.Count == 0)
                {
                    Console.WriteLine("There are no posts created yet, press Spacebar to create one!");

                    ConsoleKeyInfo userInput = Console.ReadKey();
                    switch (userInput.Key)
                    {
                    case ConsoleKey.Spacebar:
                        CreatePost();
                        break;

                    default:
                        break;
                    }
                }
                //if there is atleast one post created
                int currentButton = 1;
                while (posts.Count > 0)
                {
                    Console.ResetColor();
                    Console.Clear();

                    string[] buttonTexts = new string[posts.Count + 1];
                    for (int i = 0; i < buttonTexts.Length; i++)
                    {
                        if (i > 0)
                        {
                            buttonTexts[i] = posts[i - 1].PostName;
                        }
                        else
                        {
                            buttonTexts[i] = "Select a post and press enter to see details. Press Spacebar to create a new post!\n";
                        }
                    }

                    InteractiveMenu.buttonDrawer(buttonTexts, currentButton, ConsoleColor.Red, ConsoleColor.White);

                    ConsoleKeyInfo userInput = Console.ReadKey();
                    switch (userInput.Key)
                    {
                    case ConsoleKey.UpArrow:
                        currentButton = InteractiveMenu.buttonNavigator(1, buttonTexts.Length - 1, currentButton, ConsoleKey.UpArrow);
                        break;

                    case ConsoleKey.DownArrow:
                        currentButton = InteractiveMenu.buttonNavigator(1, buttonTexts.Length - 1, currentButton, ConsoleKey.DownArrow);
                        break;

                    case ConsoleKey.Enter:
                        PostDetail(currentButton - 1);
                        break;

                    case ConsoleKey.Spacebar:
                        CreatePost();
                        break;

                    default:
                        break;
                    }
                }
            }
        }
Exemple #12
0
        static void Main(string[] args)
        {
            InteractiveMenu mainMenu = new InteractiveMenu();

            mainMenu.Run();
        }