Inheritance: MonoBehaviour
Esempio n. 1
0
 // 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));
    }
Esempio n. 3
0
    // 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;
            }
        }
    }
Esempio n. 4
0
    void ChangueScene()
    {
        //AudioListener.volume=1;
        LoadScene load = gameObject.AddComponent <LoadScene>();

        load.Load("LogoFinalKlaus");
    }
Esempio n. 5
0
    public IEnumerator OxygenOutFailStateRoutine()
    {
        LoadScene load = new LoadScene(0, 1, "Attract", Color.black);

        StartCoroutine(load.LoadGame());
        yield return(null);
    }
Esempio n. 6
0
    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());
    }
Esempio n. 7
0
    private void Start()
    {
        loadingScript = GetComponent <LoadScene> ();

        buttonListeners();
        hideText();
    }
Esempio n. 8
0
 void Destroy()
 {
     _stage            = null;
     _challengeManager = null;
     _loadScene        = null;
     _gameControl      = null;
 }
Esempio n. 9
0
        private IEnumerator Wait(bool victory)
        {
            yield return(new WaitForSeconds(5F));

            StartCoroutine(LoadScene.LoadWorldMap());
            yield break;
        }
Esempio n. 10
0
 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
 }
Esempio n. 11
0
        /// <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);
            }
        }
Esempio n. 12
0
        protected override void OnEnable()
        {
            base.OnEnable();
            LoadScene loadScene = (LoadScene)this.target;

            loadScene.SetActiveInteraction(true);
        }
Esempio n. 13
0
    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());
    }
Esempio n. 14
0
 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);
 }
Esempio n. 15
0
 void Start()
 {
     playerHealth = player.GetComponent <Health>();
     loadScene    = GetComponent <LoadScene>();
     playerLives  = GetComponent <Lives>();
     bonfires     = GetComponent <ResetLocations>();
 }
Esempio n. 16
0
    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);
        }
    }
Esempio n. 17
0
    void onClick()
    {
        // TODO: friend_id を CafeMain に渡す
        LoadScene ls = new LoadScene();

        ls.ToCafeMain();
    }
Esempio n. 18
0
        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");
            }
        }
Esempio n. 19
0
    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;
        }
    }
Esempio n. 20
0
    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);
    }
Esempio n. 21
0
    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);
        }
    }
Esempio n. 22
0
    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;
        }
    }
Esempio n. 23
0
 void Awake()
 {
     Instance = this;
     //Get name of actual scene
     sceneCurrent = SceneManager.GetActiveScene().name;
     ItemsList    = new int[100];
 }
Esempio n. 24
0
    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>();
    }
Esempio n. 25
0
    /// <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...");
        }
    }
Esempio n. 26
0
    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();
    }
Esempio n. 27
0
 private void Start()
 {
     loadingScript = GetComponent <LoadScene> ();
     loadingPanel.SetActive(false);
     buttonListeners();
     hideText();
 }
Esempio n. 28
0
 public void OnClick()
 {
     //클릭, 이전 씬으로 전환
     //승리 시 경험치 누적, 패배 시 경험치 누적x 및
     UserInfo.instance.UserCompanionSave();
     UserInfo.instance.UserPartySave();
     LoadScene.SceneLoad("GameScene");
 }
Esempio n. 29
0
    /// <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();
    }
Esempio n. 31
0
    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();
    }