// Update is called once per frame void Update() { if (collider.TestCollisionVsCircle(playerCollider)) { LoadScene.LoadWin(); } }
void LoadScene(string sceneName) { _loadSceneGameObject.SetActive(true); LoadScene loadScene = _loadSceneGameObject.GetComponent <LoadScene>(); StartCoroutine(loadScene.LoadSceneCroutine(sceneName)); }
// Update is called once per frame void Update() { if (timed) { currTime -= Time.deltaTime; if (currTime > 0) { //textField.text = "Auto play in " + (int)currTime; Debug.Log("Auto play in: " + (int)currTime); } else { if (currTime < 0) { Debug.Log("GO TO SCENE"); LoadScene ls = LoadObject.GetComponent <LoadScene> (); ls.GoToScene(5); } else { Debug.Log("Cant find object"); } timed = false; } } }
void ChangueScene() { //AudioListener.volume=1; LoadScene load = gameObject.AddComponent <LoadScene>(); load.Load("LogoFinalKlaus"); }
public IEnumerator OxygenOutFailStateRoutine() { LoadScene load = new LoadScene(0, 1, "Attract", Color.black); StartCoroutine(load.LoadGame()); yield return(null); }
internal IEnumerator TriggerWinState() { hasWon = true; if (cryo.GetAliveCryoBeds().Count == 6) { dialogueRunner.StartDialogue("WinState-AllColonistsRemain"); } else { dialogueRunner.StartDialogue("WinState-SomeColonistsRemain"); } yield return(new WaitWhile(() => { return dialogueRunner.isDialogueRunning; })); foreach (GameObject cryo in cryo.GetAliveCryoBeds()) { Instantiate(teleportParticlePrefab, cryo.transform.position, cryo.transform.rotation, cryo.transform); yield return(new WaitForSeconds(1f)); } Instantiate(playerTeleportParticlePrefab, playerTransform.position, playerTransform.rotation, playerTransform); LoadScene load = new LoadScene(0, 10, "Attract", Color.grey); StartCoroutine(load.LoadGame()); }
private void Start() { loadingScript = GetComponent <LoadScene> (); buttonListeners(); hideText(); }
void Destroy() { _stage = null; _challengeManager = null; _loadScene = null; _gameControl = null; }
private IEnumerator Wait(bool victory) { yield return(new WaitForSeconds(5F)); StartCoroutine(LoadScene.LoadWorldMap()); yield break; }
static public int LoadScene__s_s(IntPtr l) { try { #if DEBUG var method = System.Reflection.MethodBase.GetCurrentMethod(); string methodName = GetMethodName(method); #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.BeginSample(methodName); #else Profiler.BeginSample(methodName); #endif #endif System.Int32 a1; checkType(l, 1, out a1); LoadScene.LoadScene__s(a1); pushValue(l, true); return(1); } catch (Exception e) { return(error(l, e)); } #if DEBUG finally { #if UNITY_5_5_OR_NEWER UnityEngine.Profiling.Profiler.EndSample(); #else Profiler.EndSample(); #endif } #endif }
/// <summary> /// Draw the inspector UI. /// </summary> public override void OnInspectorGUI() { LoadScene loadScene = (LoadScene)this.target; // Creates the feature header. CreateInteractionHeader("LOAD \nSCENE", "1.00", "2018"); // String EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(new GUIContent("Scene to teleport", "Remember this scene must be on the build settings."), skin.label); loadScene.SceneName = EditorGUILayout.TextField(loadScene.SceneName); EditorGUILayout.EndHorizontal(); // Vector3 EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(new GUIContent("Spawn Position", "Position to spawn the player"), skin.label); loadScene.DesiredPosition = EditorGUILayout.Vector3Field(new GUIContent(""), loadScene.DesiredPosition); EditorGUILayout.EndHorizontal(); // Creates the dropdown button select. CreateSelectionButton(null, Button.ButtonActions.PressUp); EditorUtility.SetDirty(loadScene); if (GUI.changed) { EditorSceneManager.MarkSceneDirty(loadScene.gameObject.scene); } }
protected override void OnEnable() { base.OnEnable(); LoadScene loadScene = (LoadScene)this.target; loadScene.SetActiveInteraction(true); }
IEnumerator initializeCoroutine() { //first set up stuff needed for title animation canvas = GameObject.FindGameObjectWithTag("Canvas"); //total sum of heights var sh = canvas.GetComponent <RectTransform>().rect.height; // set up the first row (exists already in prefab) var sr_0 = spritesParent.transform.GetChild(0).GetComponent <SpriteRenderer>(); var width = sr_0.sprite.bounds.size.x; var screenWidth = canvas.GetComponent <RectTransform>().rect.width; // var screenHeight = canvas.GetComponent<RectTransform>().rect.height; var tf_0 = sr_0.gameObject.GetComponent <RectTransform>(); Vector3 scale = new Vector3(1, 1, 1); scale.x = screenWidth / width; scale.y = scale.x; tf_0.localScale = scale; Vector3 pos = new Vector3(0, sh, 1); tf_0.localPosition = pos; var singleHeight = sr_0.GetComponent <RectTransform>().rect.height *sr_0.transform.localScale.y; sh -= singleHeight; numRows = (int)(sh / (singleHeight)) + 1; // set up rest of the rows (including duplicating the first row) for (int r = 1; r <= numRows; r++) { GameObject n = Instantiate(spritesParent.transform.GetChild(0).gameObject); n.transform.SetParent(spritesParent.transform); var sr = spritesParent.transform.GetChild(r).GetComponent <SpriteRenderer>(); width = sr.sprite.bounds.size.x; screenWidth = canvas.GetComponent <RectTransform>().rect.width; // var screenHeight = canvas.GetComponent<RectTransform>().rect.height; var tf = sr.gameObject.transform; scale = new Vector3(1, 1, 1); scale.x = screenWidth / width; scale.y = scale.x; tf.localScale = scale; pos = new Vector3(0, sh, 1); tf.localPosition = pos; sh -= singleHeight; } loadDone = new bool[1]; bool[] parseDone = new bool[1]; yield return(StartCoroutine(LoadScene.processCSV(loadDone, DlgCsv, setData, parseDone, false))); //TODO this script is not a loader yield return(new WaitUntil(() => loadScene.isAllLoadDone())); yield return(StartCoroutine(startTitleScreenAnim())); // yield return StartCoroutine(moveGameFlowPointer()); }
public void TurnTo() { if (!string.IsNullOrEmpty(enemyIdstxt)) { string[] enemyIds = enemyIdstxt.Split(','); if (enemyIds.Length > 0) { DungeonManager.enemyWave = new List <int[]>() { new int[enemyIds.Length] }; for (int i = 0; i < enemyIds.Length; i++) { DungeonManager.enemyWave[0][i] = int.Parse(enemyIds[i]); } } } if (!string.IsNullOrEmpty(heroIdstxt)) { string[] heroIds = heroIdstxt.Split(','); if (heroIds.Length > 0) { PlayerData.GetInstance().CurrentFightHero.Clear(); for (int i = 0; i < heroIds.Length; i++) { PlayerData.GetInstance().CurrentFightHero.Add(int.Parse(heroIds[i])); } } } LoadScene.LoadDungeon(sceneId); }
void Start() { playerHealth = player.GetComponent <Health>(); loadScene = GetComponent <LoadScene>(); playerLives = GetComponent <Lives>(); bonfires = GetComponent <ResetLocations>(); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); LoadScene sceneLoader = (LoadScene)target; isValid = ValidateScene(sceneLoader.sceneName); if (sceneLoader.sceneName != null && sceneLoader.sceneName != "") { if (!isValid) { EditorGUILayout.HelpBox("It seems that such a scene does not exist. \n" + "If it exists, make sure to add it to the scenes in the build settings!", MessageType.Error); } } else { EditorGUILayout.HelpBox("WARNING: No Scene name!", MessageType.Error); } if (GUILayout.Button("Validate Scene")) { ValidateScene(sceneLoader.sceneName); } }
void onClick() { // TODO: friend_id を CafeMain に渡す LoadScene ls = new LoadScene(); ls.ToCafeMain(); }
private IEnumerator WaitRequest_Coroutine() { yield return(StartCoroutine(Request.RequestData_Coroutine(m_FieldUsername.text, m_FieldPassword.text))); if (Request.callbackRequest.Equals("error")) { m_NotificationError.GetComponent <Animator>().Play("Fade Effect"); yield return(new WaitForSeconds(3f)); m_WaitLogin.SetActive(false); m_ButtonLogin.SetActive(true); m_NotificationError.GetComponent <Animator>().Play("Fade Effect Exit"); } else { m_NotificationSuccess.GetComponent <Animator>().Play("Fade Effect"); yield return(new WaitForSeconds(2f)); m_WaitLogin.SetActive(false); yield return(new WaitForSeconds(.5f)); m_NotificationSuccess.GetComponent <Animator>().Play("Fade Effect Exit"); LoadScene.ChangeToScene("Gameplay"); } }
void Update() { if (LoadScene.GetCurrentSceneName() != "TitleScene" && LoadScene.GetCurrentSceneName() != "Video") { if (GameManager.Instance.gameObject.GetComponent <StopBGMManager>().BGM.isPlaying) { if (BGM.isPlaying) { BGM.Pause(); } } else { if (!BGM.isPlaying) { BGM.Play(); } } } if (LoadScene.GetCurrentSceneName() == "Video") { if (BGM.isPlaying) { BGM.Pause(); } } //ヴォリュームを変わる if (BGM.volume != Volume) { BGM.volume = Volume; } }
public override bool OnGUI() { _target = (LoadScene)target; EditField("sceneReference"); if (_target.sceneReference == GetSceneActionBase.SceneSimpleReferenceOptions.SceneAtIndex) { EditField("sceneAtIndex"); } else { EditField("sceneByName"); } EditField("asynch"); EditField("loadSceneMode"); EditField("found"); EditField("foundEvent"); EditField("notFoundEvent"); return(GUI.changed); }
override protected void UpdateMe() { if (isPowered) { Decrease(); } else { Increase(); } if (text) { text.text = ((int)currentParameter).ToString(); } if ((int)currentParameter == 0 && !sceneLoading) { sceneLoading = true; LoadScene load = new LoadScene(1, 2, "Intro"); StartCoroutine(load.LoadGame()); vol = audio.volume; } if (sceneLoading) { float newVol = (vol * (audio.volume / vol)) * Time.deltaTime; Mathf.Clamp(newVol, 0, 1); audio.volume -= newVol; Debug.Log(newVol); } }
private void GotoMap() { switch (Attributes.mapID) { case 1: //GOTO Map 1 LoadScene.Load(Strings.SCEN_GAMEPLAY_MAP1); break; case 2: //GOTO Map 2 LoadScene.Load(Strings.SCEN_GAMEPLAY_MAP2); break; case 3: //GOTO Map 3 LoadScene.Load(Strings.SCEN_GAMEPLAY_MAP3); break; default: //GOTO Map 1 LoadScene.Load(Strings.SCEN_GAMEPLAY_MAP1); break; } }
void Awake() { Instance = this; //Get name of actual scene sceneCurrent = SceneManager.GetActiveScene().name; ItemsList = new int[100]; }
void Start() { messagecontrols = FindObjectOfType <MessageController>(); rigidBody = GetComponent <Rigidbody2D>(); playerAnimation = GetComponent <Animator>(); afterflightCC = FindObjectOfType <AfterFlightCollisionController>(); navscripts = FindObjectOfType <NavScripts>(); audiomanager = AudioManager.instance; scorecount = FindObjectOfType <ScoreCounter>(); respawnpoint = FindObjectOfType <RespawnPointControls>(); loadscene = FindObjectOfType <LoadScene>(); scorecounter = FindObjectOfType <ScoreCounter>(); helpcontrol = FindObjectOfType <HelpController>(); if (isReloaded) { //Debug.Log(shouldShowHelp); //Debug.Log(respawnpoint.GetRespawnPoint()); this.transform.position = respawnpoint.GetRespawnPoint(); //if (shouldShowHelp) //{ /// StartCoroutine(MessageShow()); // shouldShowHelp = false; //} isReloaded = false; } levelNav = FindObjectOfType <LevelNavControl>(); }
/// <summary> /// 現在のシーンからその前(親)のシーンへ遷移します /// </summary> public static void BackScene() { //コルーチンをstatic内で使用するためにMonoBehaviourが必要で、呼び出し元のSplashViewControllerから渡して貰おうとしたがGameObjectが永続的に存在しないためnullになる。 //TouchManagerの画面タッチの流れからこのメソッドが呼ばれるため、そこからMonoBehaviourをもらってくる MonoBehaviour mono = naichilab.InputEvents.TouchManager.Instance; LoadScene parentScene = GetParentScene(ViewControllerBase.CurrentView.SceneTag); if (ViewControllerBase.CurrentView.IsAllowSceneBack()) { if (parentScene == LoadScene.Root) { //アプリ終了する。確認ダイアログを挟んで。 Debug.Log("Root Scene"); mono.StartCoroutine(QuitAppFlow(mono)); } else if (parentScene == LoadScene.Other) { //特に何もしない Debug.Log("Other Scene"); } else { LoadLevel(parentScene); } } else { Debug.Log("DontAllowBackSceneNow..."); } }
void Start() { // Encontra o painel infoPanel = GameObject.Find("Panel Progress"); // Carrega a imagem do avatar para colocar no painel Sprite avatar = itensInfoList.avatarsToSell[SaveManager.player.avatarSelecionadoIndex].itemSprite; // Encontra a imagem do painel e muda para o avatar selecionado GameObject panelImage = infoPanel.transform.GetChild(1).gameObject; panelImage.GetComponent <Image>().sprite = avatar; // Encontra a caixa de texto do painel e inicializa com o texto contido em previousInfoText infoText = infoPanel.transform.GetChild(0).gameObject.GetComponent <Text>(); infoText.text = previousInfoText; // Encontra todos os planetas da tela planets = GameObject.FindGameObjectsWithTag("Planetas"); chosenPlanet = new bool[planets.Length]; // Completa o vetor chosenPlanet com false (inicialmente nenhum planeta foi escolhido) for (int i = 0; i < planets.Length; i++) { chosenPlanet[i] = false; } // Desabilita o botão que está no painel para entrar no planeta //startPlanet = GameObject.Find("StartPlanet").GetComponent<Button>(); //startPlanet.interactable = false; // Exibe o total de estrelas loadScene = infoPanel.GetComponent <LoadScene>(); GameObject.Find("TotalStars").GetComponent <Text>().text = "x" + SaveManager.player.totalEstrelas.ToString(); }
private void Start() { loadingScript = GetComponent <LoadScene> (); loadingPanel.SetActive(false); buttonListeners(); hideText(); }
public void OnClick() { //클릭, 이전 씬으로 전환 //승리 시 경험치 누적, 패배 시 경험치 누적x 및 UserInfo.instance.UserCompanionSave(); UserInfo.instance.UserPartySave(); LoadScene.SceneLoad("GameScene"); }
/// <summary> /// シーンをenumで指定して、名前を取得します /// </summary> public static string GetSceneName(LoadScene scene) { string sceneName; bool isUseTab; SetSceneProperty(scene, out sceneName, out isUseTab); return(sceneName); }
public void EndCredits() { Debug.Log("The End!"); StopAllCoroutines(); LoadScene ls = GetComponent <LoadScene>(); ls.loadScene(); }
private void Start() { Instance = this; ReadSceneNames(); ShowLevelSelection(); //Deactivate the ingame UI. We activate it again later. ingameUI.Deactivate(); clearedGroup.Deactivate(); noBirdsGroup.Deactivate(); titleGroup.Activate(); ReturnToLoadScene(); }