Inheritance: MonoBehaviour
Esempio n. 1
0
        /// <summary>
        /// Initializes all MVCs
        /// </summary>
        public void ManageMainWindow()
        {
            // main window
            MainMenuController ctrl = new MainMenuController();

            ctrl.MainWindow  = myWindow;
            ctrl.MainManager = this;
            ctrl.SetHandlers();

            // table window
            TableController ctrl2    = new TableController();
            TableManager    tableMgr = new TableManager();

            this.tableManager = tableMgr;
            ctrl2.TablePanel  = myWindow.tablePanel;
            myWindow.tablePanel.tableAreaPanel.TableController = ctrl2;
            ctrl2.TableManager = tableMgr;
            ctrl2.SetHandlers();

            // table settings
            TableSettingsController ctrl3 = new TableSettingsController();

            ctrl3.TableSetPanel = myWindow.tablePanel.tableSettingsPanel;
            ctrl3.TableManager  = tableMgr;
            ctrl3.SetHandlers();

            ctrl.TableManager   = tableMgr;
            tableMgr.TablePanel = myWindow.tablePanel;
        }
 // Update is called once per frame
 void MakeSingleton()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 3
0
    private IEnumerator DownLoadMenuRoutine()
    {
        Debug.Log("Checking Caching");
        while (!Caching.ready)
        {
            yield return(null);
        }
        Debug.Log("Caching is fine");


        Debug.Log("Loading Asset Bundle");
        var www = WWW.LoadFromCacheOrDownload(bundleURL, version);

        yield return(www);

        if (!string.IsNullOrEmpty(www.error))
        {
            Debug.Log(www.error);
            yield break;
        }
        Debug.Log("Loaded Asset Bundle");

        var    assetBundle = www.assetBundle;
        string menuName    = "MainMenuTemp.prefab";

        Debug.Log("Unpacking Prefab");
        var prefabRequest = assetBundle.LoadAssetAsync <GameObject>(menuName);

        yield return(prefabRequest);

        Debug.Log("Prefab Unpacked");

        downloadedMenu = prefabRequest.asset as MainMenuController;
    }
Esempio n. 4
0
    protected override void hitByRayCast()
    {
        if (thisType == PlayerSavedPrefs._OptionsType.Sounds)
        {
            DBAccess.instance.userPrefs.isSoundOn = (isOnSwitch) ? true : false;
            return;
        }
        if (thisType == PlayerSavedPrefs._OptionsType.Music)
        {
            MainMenuController m = GameObject.Find("UI_Main").GetComponent <MainMenuController>();

            if (name == "Music On")
            {
                m.mainMenuMusic.Play();
            }
            else if (name == "Music Off")
            {
                m.mainMenuMusic.Stop();
            }

            DBAccess.instance.userPrefs.isMusicOn = (isOnSwitch) ? true : false;
            return;
        }
        if (thisType == PlayerSavedPrefs._OptionsType.Controls)
        {
            DBAccess.instance.userPrefs.ControlScheme = (isOnSwitch) ? PlayerSavedPrefs._ControlScheme.Accelerometer : PlayerSavedPrefs._ControlScheme.Gyroscope;
        }
    }
Esempio n. 5
0
    // Use this for initialization
    void Awake()
    {
        // get main references.
        MainMenuController = transform.parent.GetComponent <MainMenuController> ();
        HostnameInputField = transform
                             .Find("CenterAreaPanel").transform
                             .Find("CenterAreaContainer").transform
                             .Find("ServerInfosContainer").transform
                             .Find("InputHostname").GetComponent <InputField>();
        PortInputField = transform
                         .Find("CenterAreaPanel").transform
                         .Find("CenterAreaContainer").transform
                         .Find("ServerInfosContainer").transform
                         .Find("InputPort").GetComponent <InputField>();
        ResponseText = transform
                       .Find("CenterAreaPanel").transform
                       .Find("CenterAreaContainer").transform
                       .Find("ServerInfosContainer").transform
                       .Find("ResponseText").GetComponent <Text>();
        MainMenuHelpText = transform
                           .Find("CenterAreaPanel").transform
                           .Find("MainMenuHelpText").GetComponent <Text>();
        isHostnameSet = false;
        isPortSet     = false;

        // get btn refs
        ExitBtn            = transform.Find("ExitGameBtn").GetComponent <Button> ();
        ExternalCreditsBtn = transform
                             .Find("FooterPanel").transform.Find("ExternalCreditsBtn").GetComponent <Button> ();
    }
Esempio n. 6
0
    /// <summary>
    /// Creates a Surface on a real-world plane using either a DragSurfaceMesh or TapSurfaceMesh.
    /// </summary>
    /// <returns><c>true</c>, if Surface was successfully created, <c>false</c> otherwise.</returns>
    private bool CreateSurface()
    {
        Vector3 planeCenter;
        Plane   plane;

        if (!tangoPointCloud.FindPlane(Camera.main, Camera.main.WorldToScreenPoint(Vector3.Lerp(_firstCorner, _oppositeCorner, 0.5f)), out planeCenter, out plane))
        {
            ScreenLog.Write("Please try again.");
            return(false);
        }
        var surface = Instantiate(surfaceTemplate) as Surface;

        surface.SetTransform(plane, planeCenter);
        SurfaceMesh surfaceMesh;
        var         mode = MainMenuController.GetEdgeDetectionMode();

        if (mode == "DRAG")
        {
            surfaceMesh = new DragSurfaceMesh(surface, _firstCorner, _oppositeCorner);
        }
        else
        {
            surfaceMesh = new TapSurfaceMesh(surface, FindVerticesOnPlane(plane));
        }
        if (surfaceMesh == null)
        {
            //Do I need to destroy the surfaceMesh object, too?
            ScreenLog.Write("Please try again.");
            surface.Undo();
            return(false);
        }
        surface.SetMeshAndSelect(surfaceMesh.mesh);
        return(true);
    }
    private BaseViewController GetController(Views id)
    {
        switch (id)
        {
        case Views.Settings:
            if (m_settingsController == null)
            {
                m_settingsController = new SettingsController();
            }
            return(m_settingsController);

        case Views.MainMenu:
            if (m_mainMenuController == null)
            {
                m_mainMenuController = new MainMenuController();
            }
            return(m_mainMenuController);

        default:
            if (m_settingsController == null)
            {
                m_settingsController = new SettingsController();
            }
            return(m_settingsController);
        }
    }
    void Start()
    {
        soundController          = GameObject.Find("SoundController");
        soundControllerScript    = soundController.GetComponent <SoundController>();
        MainMenuController       = GameObject.Find("MainMenuController");
        mainMenuControllerScript = MainMenuController.GetComponent <MainMenuController>();

        if (PlayerPrefs.HasKey("AdultContent") == false)
        {
            PlayerPrefs.SetInt("AdultContent", 1);
        }
        else
        {
            adultContent = PlayerPrefs.GetInt("AdultContent");
        }

        /*if (PlayerPrefs.HasKey ("Music") == false) {
         *      PlayerPrefs.SetInt ("Music", 1);
         * } else {
         *      music = PlayerPrefs.GetInt("Music");
         * }*/

        /*if (PlayerPrefs.HasKey ("Sound") == false) {
         *      PlayerPrefs.SetInt ("Sound", 1);
         * } else {
         *      sound = PlayerPrefs.GetInt("Sound");
         * }*/
    }
Esempio n. 9
0
    void onMenuClick(MainMenuController mmc)
    {
        mmc.setOffset();

        if (mmc.menuState == MainMenuController.MenuState.Main)
        {
            mmc.menuIsInTransition();

            StartCoroutine
            (
                mmc.thisGO.animation.PlayWithOptions("MainSupplies",
                () => { mmc.applyOffset(); },
                () =>
                {
                    StartCoroutine
                    (
                        mmc.thisGO.animation.PlayWithOptions("SuppliesStart",
                            () => 
							{ 
								mmc.menuState = MainMenuController.MenuState.Store; 
								mmc.animation.Play("SuppliesIdle");
							}
                        )
                    );
                }
            ));
        }
    }
Esempio n. 10
0
        static void Main(string[] args)
        {
            SetProgramPath();

            var controllerResult = new ControllerResult
            {
                Next     = NextController.MainMenu,
                Settings = null
            };

            while (controllerResult.Next != NextController.Exit)
            {
                Controller controller = null;

                switch (controllerResult.Next)
                {
                default:
                case NextController.MainMenu:
                    controller = new MainMenuController();
                    break;

                case NextController.Game:
                    controller = new GameController();
                    break;

                case NextController.Exit:
                    break;
                }

                controllerResult = controller.Start(controllerResult.Settings);
            }
        }
Esempio n. 11
0
 private void InitializeManager()
 {
     mainMenu   = GetComponent <MainMenuController>();
     inGameMenu = GetComponent <InGameMenuController>();
     pauseMenu  = GetComponent <PauseMenuController>();
     shopMenu   = GetComponent <ShopMenuController>();
 }
Esempio n. 12
0
    protected override void Enter()
    {
        _nextState = null;

        _mainMenuController = UIStorer.Instance.MainMenuController;
        _mainMenuController.On(MainMenuEvent.PLAY_BUTTON_CLICK, GoNextState);
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 14
0
 void MakeInstance()
 {
     if (instance == null)
     {
         instance = this;
     }
 }
Esempio n. 15
0
    protected override void setSprite(PlayerSavedPrefs._OptionsType type, bool isOn, MainMenuController.MenuState state, PlayerSavedPrefs._ControlScheme scheme)
    {
        if( thisType == PlayerSavedPrefs._OptionsType.Sounds && type == PlayerSavedPrefs._OptionsType.Sounds )
        {
            if (isOnSwitch) 
				thisSprite.spriteName = (isOn) ? "On_Checked" : "On_Unchecked";
            else 
				thisSprite.spriteName = (isOn) ? "Off_UnChecked" : "Off_Checked";

            return;
        }
        if (thisType == PlayerSavedPrefs._OptionsType.Music && type == PlayerSavedPrefs._OptionsType.Music )
		{
			if (isOnSwitch) 
				thisSprite.spriteName = (isOn) ? "On_Checked" : "On_Unchecked";
            else 
				thisSprite.spriteName = (isOn) ? "Off_UnChecked" : "Off_Checked";

            return;
        }
        if ( thisType == PlayerSavedPrefs._OptionsType.Controls && type == PlayerSavedPrefs._OptionsType.Controls)
        {
            if( isOnSwitch )
                thisSprite.spriteName = ( thisControlScheme == scheme ) ? "A_Checked" : "A_Unchecked";
            else
                thisSprite.spriteName = ( thisControlScheme == scheme ) ? "B_Checked" : "B_Unchecked";
        }
    }
    internal void Init(MainMenuController menuControl)
    {
        _menuControl  = menuControl;
        _audioControl = AudioController.Instance;

        CloseBtn.onClick.AddListener(() =>
        {
            _menuControl.CloseSettings();
        });

        MasterSlider.onValueChanged.AddListener(el =>
        {
            _audioControl.ChangeMasterVolume(el);
        });

        MusicSlider.onValueChanged.AddListener(el =>
        {
            _audioControl.ChangeMusicVolume(el);
        });

        SfxSlider.onValueChanged.AddListener(el =>
        {
            _audioControl.ChangeSfxVolume(el);
        });

        _audioControl.InitSliders(MasterSlider, MusicSlider, SfxSlider);
    }
Esempio n. 17
0
        private void Start()
        {
            onStartingServerPanel.gameObject.SetActive(false);

            //First, clear the maps dropdown
            mapsDropdown.ClearOptions();

            //Then get all online scenes
            onlineTCScenes = TCScenesManager.GetAllEnabledOnlineScenesInfo().ToList();

            //And all the scenes to the map dropdown
            List <string> scenes = onlineTCScenes.Select(scene => scene.DisplayNameLocalized).ToList();

            mapsDropdown.AddOptions(scenes);
            mapsDropdown.RefreshShownValue();

            //Get active network manager
            netManager = TCNetworkManager.Instance;

            //Get the images that are in the input fields
            gameNameImage   = gameNameText.GetComponent <Image>();
            maxPlayersImage = maxPlayersText.GetComponent <Image>();

            //Get the existing colors of the input fields
            gameNameImageColor   = gameNameImage.color;
            maxPlayersImageColor = maxPlayersImage.color;

            mainMenuController = GetComponentInParent <MainMenuController>();
        }
Esempio n. 18
0
        //When pressed, the button raises event for decrypting file in a specific directroy.
        //If there is any file, the methods down return it with their name and destination path to the user.
        private async void button2_Click(object sender, EventArgs e)
        {
            //Creates a service for decrypting a file.
            await MainMenuController.SetDecryptFileServicerAsync();

            MainMenuController.PopulateDecryptInformationAsync(textBox2, richTextBox1);
        }
 // Start is called before the first frame update
 void Start()
 {
     audioSource        = GetComponent <AudioSource>();
     Screen.fullScreen  = true;
     mainMenuController = this;
     loadlevel          = Loadlevel.instance;
 }
Esempio n. 20
0
        //When pressed, the button raises event for creating files in a specific directroy.
        //If there are any files, the methods down return them with the source path to the user.
        private async void button10_Click(object sender, EventArgs e)
        {
            //Creates a service for creating files
            await MainMenuController.SetCreateFileServiceAsync();

            MainMenuController.PopulateCreateInformationAsync(textBox2, richTextBox1, richTextBox2);
        }
Esempio n. 21
0
 private void UIEvents_OnGameStartButtonPressed()
 {
     InputManager.Instance.IsInGame = true;
     MainMenuController.GetComponentInChildren <Canvas>().enabled = false;
     AudioManager.Instance.Stop(MyAudioType.Main_Menu1, fade: true);
     AudioManager.Instance.Play(MyAudioType.InGame_Level1, fade: true, delay: 0.5f);
 }
Esempio n. 22
0
        public MainWindow()
        {
            _reader  = new CardReader();
            _scanner = new Scanner();
            _printer = new Printer();

            _bookDAO   = new BookDao(new BookHelper());
            _loanDAO   = new LoanDao(new LoanHelper());
            _memberDAO = new MemberDao(new MemberHelper());

            InitializeComponent();

            _reader.Show();
            _scanner.Show();
            _printer.Show();


            SetUpTestData();

            MainMenuController mainController =
                new MainMenuController(this, _reader, _scanner, _printer,
                                       _bookDAO, _loanDAO, _memberDAO);

            mainController.initialise();
        }
Esempio n. 23
0
    public void Init(MainMenuController mainMenuController, Photon.Realtime.Player player, BasePool pool)
    {
        this.mainMenuController = mainMenuController;
        lC          = SettingsController.instance.languageController;
        this.player = player;
        this.pool   = pool;
        SubscribeEvents();
        kickButton.SetActive(!player.IsLocal && PhotonNetwork.LocalPlayer.IsMasterClient);
        readyButton.GetComponent <Toggle>().interactable = player.IsLocal;

        int sameNamePlayers = PhotonNetwork.CurrentRoom.Players.Where(p => p.Value.NickName.Equals(PhotonNetwork.LocalPlayer.NickName)).Count();

        playerNickname.text = sameNamePlayers > 1 ? player.NickName + (sameNamePlayers - 1) : player.NickName;

        if (player.CustomProperties.ContainsKey("Room_PlayerReady"))
        {
            readyText.text = (bool)player.CustomProperties["Room_PlayerReady"] ? lC.GetWord("READY") : lC.GetWord("NOT_READY");
            readyButton.GetComponent <Toggle>().isOn = (bool)player.CustomProperties["Room_PlayerReady"];
        }
        else
        {
            readyButton.GetComponent <Toggle>().isOn = false;
            readyText.text = lC.GetWord("NOT_READY");
        }

        if (player.IsLocal)
        {
            readyButton.GetComponent <Toggle>().isOn = false;
            PlayerReady(false);
        }
    }
Esempio n. 24
0
	// Move the arrow left and right for UI feedback to the user
    protected void tweenArrow(float amount, MainMenuController.MenuState state)
    {
        if (state == MainMenuController.MenuState.Store && !isAnimating)
        {
            isAnimating = true;

            iTween.MoveTo(gameObject, iTween.Hash(
                "x", transform.localPosition.x + amount,
                "time", 0.2f,
                "islocal", true,
                "easetype", iTween.EaseType.easeOutExpo
                )
            );
            iTween.MoveTo(gameObject, iTween.Hash(
                "x", transform.localPosition.x,
                "time", 0.2f,
                "islocal", true,
                "delay", 0.2f,
                "oncompletetarget", gameObject,
                "oncomplete", "resetState",
                "easetype", iTween.EaseType.easeInExpo
                )
            );
        }
    }
Esempio n. 25
0
        public void SetupProgram()
        {
            // this is the "bootstrap" method, you could say.... ;)

            // create the DBManager static helper, and let it create the SQLite connection.
            DBManager.CreateConnection();

            // create menu controller, which holds a list of other controllers to generate menu.
            menuController = new MainMenuController();
            //add a reference to that controller to the static helper MenuHolder function.
            MenuHolder.SetMenuController(menuController);

            // create the login controller screen
            loginController = new LoginController();
            menuController.AddController(loginController);

            // create the table manager (loads tables from DB upon creation)
            tableManager = new TableManager();

            // create the item manager (loads items from DB upon creation)
            itemManager = new ItemManager();

            // create the TicketManager before creating the ticket controllers, so we can pass that in via reference
            ticketManager = new TicketManager();

            // create the order controller screen
            orderController = new OrderController(tableManager, itemManager, ticketManager);
            menuController.AddController(orderController);

            kitchenTicketController = new KitchenTicketController(ticketManager);
            menuController.AddController(kitchenTicketController);

            barTicketController = new BarTicketController(ticketManager);
            menuController.AddController(barTicketController);

            // create the item manager, and then the item view controller. Pass manager into controller.

            itemController = new ItemController(itemManager);
            menuController.AddController(itemController);

            // create the sales view controller, and add it to menu
            salesController = new SalesController();
            menuController.AddController(salesController);

            reservationController = new ReservationController(orderController);
            menuController.AddController(reservationController);

            // now we have all the mvc controllers created, create the "managers" for the data models.
            // each constructor should have a call to the DB helper class, to load it's data.

            customerManager = new CustomerManager();



            // load the contents from the

            // go to the login/auth page
            loginController.Show();
        }
    // Use this for initialization
    void Start()
    {
        Instance = this;

        _controllers = new List <IController>();

        Contexts    contexts = Contexts.sharedInstance;
        GameContext context  = contexts.game;

        _rootSystem = new RootSystem(contexts);

        _rootSystem.Initialize();

        HexGenerator.Instance = GetComponent <HexGenerator>();

        PlayerHealthModel = new PlayerHealthModel(20);

        PlayerHealthController PlayerHealthController = new PlayerHealthController
        {
            View       = PlayerHealthView,
            Model      = PlayerHealthModel,
            MainMenuUI = MainMenuUI
        };

        PlayerHealthController.Init();

        AboutController About = new AboutController
        {
            View    = AboutView,
            AboutUI = AboutUI
        };

        About.Init();

        MainMenuController MainMenu = new MainMenuController
        {
            View       = MainMenuView,
            MainMenuUI = MainMenuUI,
            AboutUI    = AboutUI
        };

        MainMenu.Init();

        StartModel = new StartModel();

        StartController start = new StartController
        {
            View  = StartView,
            Model = StartModel
        };

        start.Init();

        CreateMoneyController();

        TowerModel model = CreateTowerController();

        CreateTiles(context, model);
    }
Esempio n. 27
0
    // Use this for initialization
    void Start()
    {
        mainMenuController = transform.parent.GetComponent <MainMenuController>();
        exitText           = transform.GetChild(2).GetComponent <TextMeshProUGUI>();

        exitText.text = "Press " + GameData.instance.interact.ToString() + " to return to menu";
        firstStart    = false;
    }
Esempio n. 28
0
 public void Init(RoomInfo roomInfo, PlayPanel playPanel, BasePool pool, MainMenuController mainMenuController)
 {
     this.mainMenuController = mainMenuController;
     this.roomInfo           = roomInfo;
     this.pool      = pool;
     this.playPanel = playPanel;
     Refresh();
 }
Esempio n. 29
0
 private void Awake()
 {
     if (controller == null)
     {
         controller = this;
         SetPlayerAmount(0);
     }
 }
Esempio n. 30
0
 public void HideTutorial()
 {
     if (tutorialDialogUp)
     {
         StartCoroutine(MainMenuController.PlayAnimation(animation, "ShowTutorial", true, () => { }));
     }
     tutorialDialogUp = false;
 }
Esempio n. 31
0
 public Initializer()
 {
     _members     = new MembersIndex();
     _fileHandler = new FileHandler();
     _members.AddMultipleMembers(_fileHandler.LoadMemberList());
     _viewHandler        = new ViewHandler(_members);
     _mainMenuController = new MainMenuController(_viewHandler);
 }
Esempio n. 32
0
 public MainMenuButtonsManager(MainMenuController mainMenuController)
 {
     buttons = new List <Button>();
     foreach (Button b in mainMenuController.GetComponentsInChildren <Button>())
     {
         buttons.Add(b);
     }
 }
Esempio n. 33
0
    /// <summary>
    ///  添加监听,只对view中InitUI()里的UI有效
    /// </summary>
    protected override void AddListener()
    {
        PayLineViewPresenters view = this.View as PayLineViewPresenters;

        MainMenuController mainMenuController = UIMgr.Instance.GetView(EViewID.MainMenu) as MainMenuController;

        changeLineCountListener += mainMenuController.UpdateTotalBet;
    }
	// Use this for initialization
	void Awake () {
		if (menuController == null) {
			DontDestroyOnLoad (gameObject);
			menuController = this;
		}
		else if (menuController != this) {
			Destroy (gameObject);
		}
	}
    //brings all the components of a certain type to the front
    public static void ActivateTutorialComponents(MainMenuController.Tutorial tutorialType)
    {
        if (AllTutorialsComponents.ContainsKey(tutorialType)) {
            ActiveTutorialType = tutorialType;
            ChangeTextOnElementPanels(tutorialType);

            foreach (CraftingTutorialComponent component in AllTutorialsComponents[tutorialType]) {
                component.ActivateComponent();
            }
        }
    }
Esempio n. 36
0
 protected override void onSelection(SuppliesUIObject clicked, MainMenuController.MenuState state, GameObject hit)
 {
     if (clicked != null)
     {
         if (clicked.gameObject == gameObject)
         {
             moveStoreLeft(state);
             tweenArrow(-20f, state);
         }
     }
 }
	// Use this for initialization
	void Start () {
		myElem1 = "fire";
		myElem2 = "water";
		myElem3 = "earth";
		myElem4 = "air";
		//Cheats.IncreaseAllElemens (200);
		//Cheats.LockAllElements ();

		mainScript = GlobalVars.CRAFTING_CONTROLLER;
		mainScript.SetTutorialPurchaseHint(this);
		gameObject.SetActive(false);
	}
Esempio n. 38
0
    void onMenuClick( MainMenuController mmc )
    {
        mmc.setOffset();

        if (mmc.menuState == MainMenuController.MenuState.Main)
        {
            mmc.menuIsInTransition();
            
			if( onCharacterSelectStart != null )
				onCharacterSelectStart();
			
            StartCoroutine
            (
                mmc.thisGO.animation.PlayWithOptions("MainPlay",
                () => { mmc.applyOffset(); },
                () =>
                {
                    StartCoroutine
                    (
                        mmc.thisGO.animation.PlayWithOptions("EnemySelStart",
                            () => { mmc.menuState = MainMenuController.MenuState.Character; }
                        )
                    );
                })
            );
        }
        else if (mmc.menuState == MainMenuController.MenuState.Store)
        {
            mmc.menuIsInTransition();

			if( onCharacterSelectStart != null )
				onCharacterSelectStart();;
			
            StartCoroutine
            (
                mmc.thisGO.animation.PlayWithOptions("SuppliesPlay",
                    () => { mmc.applyOffset(); },
                    () =>
                    {
                        StartCoroutine
                        (
                            mmc.thisGO.animation.PlayWithOptions("EnemySelStart",
                                () => { mmc.menuState = MainMenuController.MenuState.Character; }
                            )
                        );
                    }
                )
            );
        }
    }
	void Awake() {
		controller = GetComponent<MainMenuController>();

		beginSimulation = GameObject.Find("BeginSimulation").GetComponent<Button>();

		startHours = GameObject.Find ("StartHours").transform.FindChild("Text").GetComponent<Text>();
		startMinutes = GameObject.Find ("StartMinutes").transform.FindChild("Text").GetComponent<Text>();
		startSeconds = GameObject.Find ("StartSeconds").transform.FindChild("Text").GetComponent<Text>();

		startAMPM = GameObject.Find("StartAMPM").GetComponent<Dropdown>();

		runTime = GameObject.Find("RunTime").GetComponent<Dropdown>();


	}
Esempio n. 40
0
 void Awake()
 {
     inShade = false;
     sunscreen = false;
     shadeLayer = LayerMask.GetMask("Shade");
     // Setting up references.
     Canvas canvas = FindObjectOfType<Canvas>();
     inGameMenu = canvas.GetComponent<MainMenuController>();
     levelController = levelControlGO.GetComponent<LevelController>();
     rb = gameObject.GetComponent<Rigidbody2D>();
     groundCheck = transform.Find("GroundCheck");
     wallCheck = wallGOCheck.transform;
     //anim = GetComponent<Animator>();
     if (levelController.sunny)
         InvokeRepeating("SunDamage", 5, 1);
 }
    //changes the count on the elment panels based on the tutorial
    public static void ChangeTextOnElementPanels(MainMenuController.Tutorial tutorialType)
    {
        string text;
        if (tutorialType == MainMenuController.Tutorial.Gathering) {
            text = GatheringTutorialElementPanelText;
        } else if (tutorialType == MainMenuController.Tutorial.Crafting) {
            text = CraftingTutorialElementPanelText;
        } else {
            return;
        }

        foreach (CraftingTutorialComponent component in AllTutorialsComponents[tutorialType]) {
            if (component.gameObject.name.Contains(ElementPanelName)) {
                component.SetText(text);
            }
        }
    }
Esempio n. 42
0
    void onSelection(SuppliesUIObject clicked, MainMenuController.MenuState state, GameObject hit )
    {
        if (clicked != null)
        {
			// Temporary bypass to prevent user from purchasing bullets 
			if (clicked.supplyType == SuppliesUIObject._SupplyType.Ammo) {
				GameObject bullet;
				bullet = GameObject.Find("Top Ammo");
				return;
			}

            if (state != MainMenuController.MenuState.InTransition && clicked.itemLocale == SuppliesUIObject._ItemLocale.StoreTop)
            {
                MainMenuController.instance.menuState = MainMenuController.MenuState.InTransition;

                iTween.MoveTo(gameObject, iTween.Hash(
                        "x", clicked.transform.localPosition.x,
                        "time", 0.4f,
                        "islocal", true,
                        "easetype", iTween.EaseType.easeOutExpo
                    )
                );
                iTween.ScaleTo(clicked.gameObject, iTween.Hash(
                        "x", clicked.transform.localScale.x * 1.5f,
                        "y", clicked.transform.localScale.y * 1.5f,
                        "time", 0.2f,
                        "easetype", iTween.EaseType.easeOutExpo
                    )
                );
                iTween.ScaleTo(clicked.gameObject, iTween.Hash(
                        "x", clicked.transform.localScale.x,
                        "y", clicked.transform.localScale.y,
                        "time", 0.2f,
                        "delay", 0.2f,
                        "oncompletetarget", gameObject,
                        "oncomplete", "stopAnimating",
                        "oncompleteparams", state,
                        "easetype", iTween.EaseType.easeInExpo
                    )
                );
            }
        }
    }
Esempio n. 43
0
 protected override void setSprite(PlayerSavedPrefs._OptionsType type, bool isOn, MainMenuController.MenuState state, PlayerSavedPrefs._ControlScheme scheme)
 {
     if (type == thisType)
     {
         // Not sure why this check has to be here for iTweens
         if (this != null && state != MainMenuController.MenuState.InTransition )
         {
             MainMenuController.instance.menuIsInTransition();
             iTween.ShakePosition(gameObject, iTween.Hash(
                 "amount", new Vector3(20f, 20f, 0),
                 "time", 0.4f,
                 "islocal", true,
                 "oncompletetarget", gameObject,
                 "oncomplete", "resetState",
                 "oncompleteparams", state
                 )
             );
         }
     }
 }
Esempio n. 44
0
 // Use this for initialization
 void Start()
 {
     Canvas canvas = FindObjectOfType<Canvas>();
     score = new Score();
     mainMenu = canvas.GetComponentInChildren<MainMenuController>();
     menuOpen = mainMenu.mainMenu.activeSelf;
     victory = false;
     restart = false;
     gameOver = false;
     restartText.text = "";
     gameOverText.text = "";
     CreateRoidField(roidNumber, maxRoidSize);
     //if (!bossScene)
         //StartCoroutine(SpawnWaves());
         //else
         //    StartCoroutine(BossStates());
  
     StartCoroutine(CheckForDead());
     UpdateScore();
     levelNumber = SceneManager.GetActiveScene().buildIndex;
 }
Esempio n. 45
0
    void onSelection(SuppliesUIObject clicked, MainMenuController.MenuState state, GameObject hit)
    {
        if (clicked != null)
        {
            if (state == MainMenuController.MenuState.Store && clicked.itemLocale == SuppliesUIObject._ItemLocale.StashTop )
            {
                MainMenuController.instance.menuState = MainMenuController.MenuState.InTransition;

                iTween.MoveTo(gameObject, iTween.Hash(
                    "x", clicked.transform.localPosition.x,
                    "time", 0.4f,
                    "islocal", true,
                    "easetype", iTween.EaseType.easeOutExpo
                    )
                );

                iTween.ScaleTo(clicked.gameObject, iTween.Hash(
                    "x", clicked.transform.localScale.x * 1.5f,
                    "y", clicked.transform.localScale.y * 1.5f,
                    "time", 0.2f,
                    "easetype", iTween.EaseType.easeOutExpo
                    )
                );

                iTween.ScaleTo(clicked.gameObject, iTween.Hash(
                    "x", clicked.transform.localScale.x,
                    "y", clicked.transform.localScale.y,
                    "time", 0.2f,
                    "delay", 0.2f,
                    "oncompletetarget", gameObject,
                    "oncomplete", "stopAnimating",
                    "oncompleteparams", state,
                    "easetype", iTween.EaseType.easeInExpo
                    )
                );
            }
        }
    }
Esempio n. 46
0
    protected void moveGridRight(MainMenuController.MenuState state)
    {
        SupplyGrid active = getActiveGrid();
        active.moveDirection = SupplyGrid._moveDirection.Right;

        if (active.curPos + 1 <= active.itemArray.Count - 1 && MainMenuController.instance.menuState == MainMenuController.MenuState.Store)
        {
            MainMenuController.instance.menuIsInTransition();
            lastState = state;

            //Debug.Log(MainMenuController.instance.menuState);
            iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                "from", windowPanel.clipRange.x,
                "to", active.itemArray[active.curPos + 1].transform.localPosition.x,
                "time", 0.4f,
                "onupdatetarget", gameObject,
                "onupdate", "moveCenter",
                "easetype", iTween.EaseType.easeOutExpo
                )
            );
            iTween.ValueTo(windowPanel.gameObject, iTween.Hash(
                "from", windowPanel.transform.localPosition.x,
                "to", windowPanel.transform.localPosition.x - active.cellWidth,
                "time", 0.4f,
                "onupdatetarget", gameObject,
                "onupdate", "movePosition",
                "oncompletetarget", gameObject,
                "oncomplete", "updateCurPos",
                "oncompleteparams", active,
                "easetype", iTween.EaseType.easeOutExpo
                )
            );
        }
        else if (MainMenuController.instance.menuState == MainMenuController.MenuState.Store)
            gridCantMove(20f, state);
    }
 /// <summary>
 /// Initializes the main menu view
 /// </summary>
 /// <param name="_mainMenuController">The main menu controller.</param>
 public override void Initialize(BaseController _mainMenuController)
 {
     m_mainMenuController = (MainMenuController)_mainMenuController;
     base.Initialize(_mainMenuController);
 }
Esempio n. 48
0
 // Use this for initialization
 void Start()
 {
     menu = MainMenuController.menu;
     if (primaryWeapon != null) {
         gun = primaryWeapon.GetComponent<WeaponController> ();
     } else if (secondaryWeapon != null) {
         gun = secondaryWeapon.GetComponent<WeaponController> ();
     } else {
         // If no weapon is selected
     }
     inMenu = false;
     Cursor.lockState = CursorLockMode.Locked;
     Cursor.visible = false;
     health = 100f;
     lookSpeed = 5f;
     moveSpeed = 5f;
     sprintSpeedModifier = 1.5f;
     jumpHeight = 0.1f;
 }
 //takes an event call from main menu controller and executes the corresponding tutorial
 //uses an enum Tutorial from MainMenuController to decide which tutorial to execute
 private void TutorialEventHandler(MainMenuController.Tutorial tutorial)
 {
     Utility.Log(tutorial + " is now playing");
     //#####out
     //if (tutorial == MainMenuController.Tutorial.Gathering) {
         //ExecuteTutorial(OnElementsDraggedIntoGatheringTutorialBegan, tutorial);
     //} else
     if (tutorial == MainMenuController.Tutorial.Crafting) {
         ExecuteTutorial(OnCraftingModeTutorialBegan, tutorial);
     } else if (tutorial == MainMenuController.Tutorial.TierSwitch) {
         ExecuteTutorial(OnTierSwitchingTutorialBegan, tutorial);
     } else if (tutorial == MainMenuController.Tutorial.BuyHint) {
         ExecuteTutorial(OnBuyHintTutorialBegan, tutorial);
     } else if (tutorial == MainMenuController.Tutorial.UpgradePowerup) {
         ExecuteTutorial(OnBuyPowerUpUpgradeTutorialBegan, tutorial);
     }
 }
 // Use this for initialization
 void Start()
 {
     nameObject = transform.parent.FindChild ("WhatAmI").gameObject;
     myName = nameObject.GetComponent<Text>().text;
     mainScript = GameObject.Find ("CraftingCamera").GetComponent<MainMenuController> ();
 }
Esempio n. 51
0
 protected abstract void setSprite(PlayerSavedPrefs._OptionsType type, bool isOn, MainMenuController.MenuState state, PlayerSavedPrefs._ControlScheme scheme);
Esempio n. 52
0
 // Use this for initialization
 void Start()
 {
     menu = this;
     isVisible = false;
     UpdateVisibility ();
 }
Esempio n. 53
0
    void onMenuClick( MainMenuController mmc )
    {
        mmc.setOffset();

        if (mmc.menuState == MainMenuController.MenuState.Main)
        {
			if( Application.platform == RuntimePlatform.IPhonePlayer )
				ChartBoostBinding.trackEvent( "On Options Click" );
			
            mmc.menuIsInTransition();

            StartCoroutine
            (
                mmc.thisGO.animation.PlayWithOptions("MainOptions",
                () => { mmc.applyOffset(); },
                () =>
                {
                    StartCoroutine
                    (
                        mmc.thisGO.animation.PlayWithOptions("OptionsStart",
                            () => 
							{
								mmc.menuState = MainMenuController.MenuState.Options; 
								mmc.thisGO.animation.Play("OptionsIdle");
							}
                        )
                    );
                }
            ));
        }
        else if (mmc.menuState == MainMenuController.MenuState.Options)
        {
            mmc.menuIsInTransition();

            StartCoroutine
            (
                mmc.thisGO.animation.PlayWithOptions("OptionsBack",
                    () => { mmc.applyOffset(); },
                    () => { mmc.playMenuStart(); } 
                )
            );
        }
        else if (mmc.menuState == MainMenuController.MenuState.Character )
        {
            mmc.menuIsInTransition();

            StartCoroutine
            (
                mmc.thisGO.animation.PlayWithOptions("EnemySelBack",
                    () => { mmc.applyOffset(); },
                    () => { mmc.playMenuStart(); }
                )
            );
			
			if( onOptionsBack != null )
				onOptionsBack();
        }
        else if (mmc.menuState == MainMenuController.MenuState.Store)
        {
			if( Application.platform == RuntimePlatform.IPhonePlayer )
				ChartBoostBinding.trackEvent( "On Store Enter" );
				
            mmc.menuIsInTransition();

            StartCoroutine
            (
                mmc.thisGO.animation.PlayWithOptions("SuppliesBack",
                    () => { mmc.applyOffset(); },
                    () => { mmc.playMenuStart(); }
                )
            );
        }
    }
Esempio n. 54
0
    protected override void setActiveGrid(SuppliesUIObject clicked, MainMenuController.MenuState state, GameObject hit)
    {
			
        if (clicked != null)
        {
			// Temporary bypass to prevent user from purchasing bullets 
			if (clicked.supplyType == SuppliesUIObject._SupplyType.Ammo) {
				//clicked.mWidget.alpha = 0.5f;
				return;
			}

            if ( clicked.supplyType == SuppliesUIObject._SupplyType.Gun || 
                 clicked.supplyType == SuppliesUIObject._SupplyType.Health || 
                 clicked.supplyType == SuppliesUIObject._SupplyType.Ammo ) {   
                int j = 0;
                for (int i = 0; i < grids.Length; i++)
                {
                    if (grids[i].itemArray[0].supplyType == clicked.supplyType)
                    {
                        grids[i].isActive = true;
                        j = i;
                    }
                    else { grids[i].isActive = false; }
                }
                StartCoroutine(setCenterToCurPos(j));
            }
        }
    }
Esempio n. 55
0
 void Start()
 {
     mm = GameObject.FindGameObjectWithTag("MenuParent").GetComponent<MainMenuController>();
 }
Esempio n. 56
0
 void stopAnimating( MainMenuController.MenuState lastState ) { MainMenuController.instance.menuState = lastState; }
Esempio n. 57
0
 void resetState(MainMenuController.MenuState state)
 {
     transform.localPosition = Vector3.zero;
     MainMenuController.instance.menuState = state;
 }
Esempio n. 58
0
	/* Used to call abstractly declared delegates to signal StashController
	 * to move the grid and update information accordingly. */
    protected abstract void onSelection(SuppliesUIObject clicked, MainMenuController.MenuState state, GameObject hit);
	void Start() {
		instance = this;
	}
Esempio n. 60
0
    void Start()
    {
        eventSys = EventSystem.current;
        mm = GameObject.FindGameObjectWithTag("MenuParent").GetComponent<MainMenuController>();
        profilePrefab = Resources.Load("Prefabs/ProfileButton") as GameObject;
        saveDummy = GetComponent<PlayerOptionsManager>();
        keys = editMenu.GetComponentsInChildren<KeybindButton>();
        //Debug.Log(keys.Length);

        standard = prevPage.colors;
        grayed = prevPage.colors;
        grayed.normalColor = gray;
        grayed.highlightedColor = gray;
        grayed.pressedColor = gray;

        RefreshProfiles();
    }