// Update is called once per frame void Update() { GameObject firstCanvas = GameObject.Find("InitialScreen"); GameObject sceneOrgan = GameObject.Find("SceneOrcastrator"); SceneOrganizer sceneScript = sceneOrgan.GetComponent <SceneOrganizer> (); if (StartButtonPushed == true) { firstCanvas.GetComponent <CanvasGroup> ().alpha -= (Time.deltaTime * AlphaChangeRate); //MyAni.Play ("StartSceneCamAni", -1, 0f); MyAni.SetBool("StartButtonPushed", true); } if (firstCanvas.GetComponent <CanvasGroup> ().alpha <= 0) { firstCanvas.GetComponent <Canvas> ().enabled = false; StartCoroutine(InstructionTime()); } if (NextLevelPush == true) { if (Input.GetKey(KeyCode.Return) || Input.GetButtonDown("XboxAButton") || Input.GetButtonDown("XboxStartButton")) { sceneScript.NextLevel(); } } if (Input.GetButtonDown("XboxAButton") || Input.GetButtonDown("XboxStartButton")) { StartButtonPushed = true; } }
//Called when the player hits the last waypoint, the one named "LevelEnd" IEnumerator EndGame() { GameObject sceneOrgan = GameObject.Find("SceneOrcastrator"); SceneOrganizer sceneScript = sceneOrgan.GetComponent <SceneOrganizer> (); //Wait TimeTillEnd seconds before quitting the game yield return(new WaitForSeconds(TimeTillEnd)); //Application.Quit (); //Instead, call the next level sceneScript.NextLevel(); }
protected override void Start() { base.Start(); gameState = SceneOrganizer.Get <GameState>(); foreach (Topic topic in topics) { topic.OnRerollClicked += OnTopicRerollClicked; } buttonNext.onClick.AddListener(OnButtonNextClicked); }
/// <summary> /// Called on initialization /// </summary> private void Awake() { // Use this class instance as singleton Instance = this; // Add the ImageCapture class to this Gameobject gameObject.AddComponent <ImageCapture>(); // Add the CustomVisionAnalyser class to this Gameobject gameObject.AddComponent <CustomVisionAnalyzer>(); // Add the CustomVisionObjects class to this Gameobject gameObject.AddComponent <CustomVisionObjects>(); }
void LevelReset() { GameObject sceneOrgan = GameObject.Find("SceneOrcastrator"); SceneOrganizer sceneScript = sceneOrgan.GetComponent <SceneOrganizer> (); timer += Time.deltaTime; if (timer >= resetAfterDeathTime) { //Application.Quit(); //Calls the restart script from the SceneOrganizer sceneScript.RestartLevel(); //SceneManager.LoadScene ("Level_1_FullEnvironment"); //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex); //Application.LoadLevel(0); //Reset Scene //sceneFadeInOut.EndScene(); } }
private void Awake() { //make this work like a singlton Instance = this; //Before we start add all the texts to the dict DE.Add(0, "Willkommen!\nAls Einführung: Den Zeiger bewegen Sie mit ihrem Kopf und\nklicken können Sie mit der Fernbedienung in ihrer Hand.\nBitte drücken Sie Start um zu beginnen."); DE.Add(1, "Aufgabe 1:\nBitte kaufen Sie nun einen SNACK zum\nEssen ihrer Wahl (kein Getränk).\nMit Klick auf einem Produkt\nerhalten Sie mehr Infos.\nUnd Auswählen können sie mit Select."); DE.Add(2, "Aufgabe 2:\nBitte kaufen Sie nun ein GETRÄNK\nihrer Wahl (kein Essen).\nMit Klick auf einem Produkt\nerhalten Sie mehr Infos.\nUnd Auswählen können sie mit Select."); DE.Add(3, "Aufgabe 3:\nBitte wählen Sie nun den GESÜNDESTEN SNACK\nim Automat aus, indem Sie ein Produkt auswählen\nund Select drücken."); DE.Add(4, "Aufgabe 4:\nBitte wählen Sie nun das GESÜNDESTE GETRÄNK\n im Automat aus, indem Sie ein Produkt auswählen\nund Select drücken."); DE.Add(5, "Vielen Dank für die Teilnahme,\nSie können die Brille jetzt abnehmen"); Labels.Add("de", DE); EN.Add(0, "Welcome!\nTo Start: You can move the cursor by tilting your head\nand you can click by pressing the button on the remote control.\nPlease press Start to begin."); EN.Add(1, "Task 1:\nPlease buy a SNACK of your choice at\nthe machine (no drink). With a click\non a product you can recieve extra info.\nAnd with clicking Select you choose a product."); EN.Add(2, "Task 2:\nPlease buy a DRINK of your choice at\nthe machine (no food). With a click\non a product you can recieve extra info.\nAnd with clicking Select you choose a product."); EN.Add(3, "Task 3:\nPlease select the HEALTHIEST SNACK\n in the machine, by clicking on a product\n and clicking Select."); EN.Add(4, "Task 4:\nPlease select the HEALTHIEST DRINK\n in the machine, by clicking on a product\n and clicking Select."); EN.Add(5, "Thank you!\nYou can now take off the headset."); Labels.Add("en", EN); ExplainBoard.SetActive(false); }
private void OnDestroy() { SceneOrganizer.Unregister(this); }
private void Awake() { SceneOrganizer.Register(this); }
protected override void Start() { base.Start(); gameState = SceneOrganizer.Get <GameState>(); }
/// <summary> /// Initializes the Framework. /// Sets up all required modules. /// </summary> public void Initialize() { SceneOrganizer.Initialize(new SceneOrganizer()); }
protected virtual void Start() { screenManager = SceneOrganizer.Get <ScreenManager>(); screenManager.RegisterScreen(this, showOnStart); }