Begin() public static méthode

public static Begin ( string levelName, bool showGrid = false, float fadeOutTime = 0.5f, float r = 0.0f, float g = 0.0f, float b = 0.0f, float a = 1.0f ) : void
levelName string
showGrid bool
fadeOutTime float
r float
g float
b float
a float
Résultat void
    void OnTriggerEnter(Collider other)
    {
        if ((other.gameObject.CompareTag("Throwable")) && (ballReset.starCount >= 2))
        {
            // Create a temporary reference to the current scene.
            Scene currentScene = SceneManager.GetActiveScene();

            // Retrieve the name of this scene.
            string sceneName = currentScene.name;

            switch (sceneName)
            {
            case ("Scene1"):
                SteamVR_LoadLevel.Begin("Scene2");
                break;

            case ("Scene2"):
                SteamVR_LoadLevel.Begin("Scene3");
                break;

            case ("Scene3"):
                SteamVR_LoadLevel.Begin("Scene4");
                break;

            case ("Scene4"):
                SteamVR_LoadLevel.Begin("Scene5");
                break;

            default:
                SteamVR_LoadLevel.Begin("Scene1");
                break;
            }
        }
    }
    public void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            if (nxtIsland)
            {
                NextIsland.levelRestarted  = true;
                nxtIsland.islevelrestarted = NextIsland.levelRestarted;
            }
            if (GameModeScript.GameMode == 1)
            {
                //cstats.Save();
                //Temporarily commented out of VR version

                if (LevelProgression.MasterLevelMultiplier == 4)
                {
                    GameObject.Find("RightController").GetComponent <AirsigPickaxe>().enabled = false;

                    SteamVR_LoadLevel.Begin("smallcave1");
                    //SceneManager.LoadScene(2);
                }
                if (LevelProgression.MasterLevelMultiplier == 9)
                {
                    GameObject.Find("RightController").GetComponent <AirsigPickaxe>().enabled = false;

                    SteamVR_LoadLevel.Begin("bosstest");
                    //SceneManager.LoadScene("bosstest");
                }
                if (LevelProgression.MasterLevelMultiplier == 14)
                {
                    GameObject.Find("RightController").GetComponent <AirsigPickaxe>().enabled = false;

                    SteamVR_LoadLevel.Begin("smallcave2");
                    //SceneManager.LoadScene("smallcave2");
                }
                if (LevelProgression.MasterLevelMultiplier == 19)
                {
                    GameObject.Find("RightController").GetComponent <AirsigPickaxe>().enabled = false;

                    SteamVR_LoadLevel.Begin("bosscave2");
                    //SceneManager.LoadScene("bosscave2");
                }
                if (LevelProgression.MasterLevelMultiplier == 24)
                {
                    GameObject.Find("RightController").GetComponent <AirsigPickaxe>().enabled = false;

                    SteamVR_LoadLevel.Begin("smallcave3");
                    // SceneManager.LoadScene("smallcave3");
                }
                if (LevelProgression.MasterLevelMultiplier == 29)
                {
                    //SteamVR_LoadLevel.Begin("finaldungeon");
                    GameObject.Find("RightController").GetComponent <AirsigPickaxe>().enabled = false;

                    //SceneManager.LoadScene("finaldungeon");
                    StartCoroutine(loadFinal());
                }
            }
        }
    }
Exemple #3
0
    public void ResetGame()
    {
        // Restart the current game.
        string levelName = "Level" + level.ToString();

        SteamVR_LoadLevel.Begin(levelName);
    }
    public void GotoGame()
    {
        SoundManager.Instance.StopBGM();
        SteamVR_LoadLevel.Begin("game");

        StartCoroutine(WaitForLoading(gameBGM));
    }
 public void PlayerWon()
 {
     //winUI.SetActive(true);
     currLevel = (currLevel + 1) % 4;
     SteamVR_LoadLevel.Begin(levelNames[currLevel]);
     //Debug.Log("Load Next Level");
 }
Exemple #6
0
 private void OnCollisionEnter(Collision col)
 {
     if (col.gameObject.CompareTag("Ground"))
     {
         ground.Play();
         gameObject.transform.position = ballInstantiate.transform.position;
         //Destroy(gameObject);
         //Instantiate(resetBall, ballInstantiate.transform.position, Quaternion.identity);
         collectible.SetActive(true);
         collectible1.SetActive(true);
     }
     if (col.gameObject.CompareTag("Goal"))
     {
         if (CollectibleStar_3_.isTouched && CollectibleStar_3_1.isTouched1)
         {
             winState = true;
             Debug.Log(winState);
         }
         if (winState)
         {
             Destroy(gameObject);
             SteamVR_LoadLevel.Begin("Level4");
             winState = false;
         }
         else
         {
             Destroy(gameObject);
             gameObject.transform.position = ballInstantiate.transform.position;
             //Instantiate(resetBall, ballInstantiate.transform.position, Quaternion.identity);
             collectible.SetActive(true);
             //SteamVR_LoadLevel.Begin("Level3");
             winState = false;
         }
     }
 }
    /// <summary>
    /// LoadScene
    /// </summary>
    /// <param name="targetTrans"></param>
    /// <param name="player"></param>
    private void LoadScene(Transform targetTrans, Transform player)                                  //load scene by param's name
    {
        switch (targetTrans.name)
        {
        case "YongLing":
            SteamVR_LoadLevel.Begin("YongLing", false, 1, 1, 1, 1, 1);

            break;

        case "JinSha":
            SteamVR_LoadLevel.Begin("JinSha", false, 1, 1, 1, 1, 1);

            break;

        case "ZhuYueLian":
            SteamVR_LoadLevel.Begin("ZhuYueLian", false, 1, 1, 1, 1, 1);

            break;

        default:
            break;
        }

        //SteamVR_LoadLevel.Begin(targetTrans.name,false,5,1,1,1,1);
    }
    private void OnTriggerEnter(Collider other)
    {
        var colliderTag = other.gameObject.tag;

        if (TagUtility.IsButton(colliderTag))
        {
            if (Controller.GetHairTrigger())
            {
                if (TagUtility.IsTutorialButton(colliderTag) && IsGameScene())
                {
                    if (MenuManagerBehaviour.Menu)
                    {
                        Destroy(MenuManagerBehaviour.Menu);
                    }
                    transform.parent.GetComponent <MovementChangeBehaviour>().MovementState = State.Tutorial;
                }
                else if (TagUtility.IsRestartButton(colliderTag))
                {
                    PlayerPrefs.DeleteAll();
                    SteamVR_LoadLevel.Begin("Game");
                }
                else if (TagUtility.IsQuitButton(colliderTag))
                {
                    PlayerPrefs.DeleteAll();
                    Application.Quit();
                }
            }
        }
    }
Exemple #9
0
 // Update is called once per frame
 void Update()
 {
     if (GetComponent <DraggableObject>().held)
     {
         SteamVR_LoadLevel.Begin(scene);
     }
 }
    public void LoadPlayground()
    {
        // Load player and able bodied avatar (without adaptive tracker).
        SaveSystem.LoadUserData("DB1942174");
        AvatarSystem.LoadPlayer(SaveSystem.ActiveUser.type, AvatarType.AbleBodied);
        AvatarSystem.LoadAvatar(SaveSystem.ActiveUser, AvatarType.AbleBodied, false);
        // Change the number for the forearm tracker being used
        GameObject            faTrackerGO   = GameObject.FindGameObjectWithTag("ForearmTracker");
        SteamVR_TrackedObject steamvrConfig = faTrackerGO.GetComponent <SteamVR_TrackedObject>();

        steamvrConfig.index = SteamVR_TrackedObject.EIndex.Device5;
        //
        KeepOnLoad();
        // Load level.
        SteamVR_LoadLevel.Begin("DemoPlayground");

        /*
         * KeepOnLoad();
         * // Load level.
         * if (AvatarSystem.AvatarType == AvatarType.Transradial)
         * {
         *  GameObject prosthesisManagerGO = GameObject.FindGameObjectWithTag("ProsthesisManager");
         *  FakeEMGBoniHand prosthesisManager = prosthesisManagerGO.GetComponent<FakeEMGBoniHand>();
         *  prosthesisManager.InitializeProsthesis();
         * }
         * SteamVR_LoadLevel.Begin("FantasyTemplate");
         */
        //SteamVR_LoadLevel.Begin("PhotoStage");
    }
Exemple #11
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.name.Contains("Body"))
     {
         SteamVR_LoadLevel.Begin(scene);
     }
 }
Exemple #12
0
    // Update is called once per frame
    void Update()
    {
        var R_device = SteamVR_Controller.Input((int)_R_trackedObj.index);
        var L_device = SteamVR_Controller.Input((int)_L_trackedObj.index);

        if (Input.GetKeyDown(KeyCode.Return))
        {
            isPCReady          = true;
            PC_Ready_Text.text = "Your Journey Will Begin Shortly...";
            StopCoroutine("PCTextFlash");
            PC_Ready_Text.color = Color.white;
        }
        if (R_device.GetTouch(SteamVR_Controller.ButtonMask.Trigger) && L_device.GetTouch(SteamVR_Controller.ButtonMask.Trigger))
        {
            _GripTimer += Time.deltaTime;
        }
        else
        {
            _GripTimer = 0f;
        }
        if (_GripTimer > 2f)
        {
            _isVRReady         = true;
            VR_Ready_Text.text = "Prepare to Defend Heaven...";
            StopCoroutine("VRTextFlash");
            VR_Ready_Text.color = Color.white;
        }
        if (_isVRReady && isPCReady)
        {
            //SceneManager.LoadScene ("Level01_VR");
            SteamVR_LoadLevel.Begin("Level01_VR");
        }
    }
Exemple #13
0
 public void GoToNextLevel()
 {
     if (currentLevel + 1 <= levels.Length)
     {
         SteamVR_LoadLevel.Begin(levels[currentLevel + 1]);
     }
 }
Exemple #14
0
 void OnTriggerEnter(Collider col)
 {
     if (col.gameObject.CompareTag("Ground"))
     {
         ReStart();
     }
     else if (col.gameObject.CompareTag("Star"))
     {
         col.gameObject.SetActive(false);
         starHandler.AddScore();
     }
     else if (col.gameObject.CompareTag("Goal"))
     {
         if (starHandler.IsCompleted())
         {
             SteamVR_LoadLevel.Begin(NextScene);
         }
         else
         {
             ReStart();
         }
     }
     else if (col.gameObject.CompareTag("StartLevel"))
     {
         ReStart();
         startInstruction.SetActive(false);
     }
     else if (col.gameObject.CompareTag("PlayArea"))
     {
         isInPlayArea = true;
     }
 }
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.F1))
        {
            SteamVR_LoadLevel.Begin("GabrielTest");
        }
        if (Input.GetKeyDown(KeyCode.F2))
        {
            SteamVR_LoadLevel.Begin("Hoops");
        }

        foreach (ControlerController c in controllers)
        {
            if (c._joint != null)
            {
                if (c._joint.gameObject.name == "Hoop")
                {
                    SteamVR_LoadLevel.Begin("Hoops");
                }
                else if (c._joint.gameObject.name == "Racket")
                {
                    SteamVR_LoadLevel.Begin("GabrielTest");
                }
            }
        }
    }
 /// <summary>
 /// OnCollisionEnter is called when this collider/rigidbody has begun
 /// touching another rigidbody/collider.
 /// </summary>
 /// <param name="other">The Collision data associated with this collision.</param>
 void OnCollisionEnter(Collision other)
 {
     if (other.collider.CompareTag("Throwable"))
     {
         if (other.gameObject.GetComponent <BallReset>().areAllCollected&& platform.GetComponent <AntiCheat>().onPlatform)
         {
             Debug.Log("Yes Goal");
             if (scene.name.Equals("Intro"))
             {
                 SteamVR_LoadLevel.Begin("Scene1");
             }
             else if (scene.name.Equals("Scene1"))
             {
                 SteamVR_LoadLevel.Begin("Scene2");
             }
             else if (scene.name.Equals("Scene2"))
             {
                 SteamVR_LoadLevel.Begin("Scene3");
             }
             else if (scene.name.Equals("Scene3"))
             {
                 SteamVR_LoadLevel.Begin("Scene4");
             }
             else if (scene.name.Equals("Scene4"))
             {
                 exit = true;
             }
         }
         else
         {
             Debug.Log("No Goal");
         }
     }
 }
    private void Update()
    {
        if (device.GetPressDown(SteamVR_Controller.ButtonMask.ApplicationMenu))
        {
            Tutorial.SetActive(!Tutorial.activeSelf);
        }

        if (device.GetPress(SteamVR_Controller.ButtonMask.ApplicationMenu))
        {
            holdTime += Time.deltaTime;
            if (holdTime > 5f)
            {
                SteamVR_LoadLevel.Begin("Test");
            }
        }

        if (device.GetPressUp(SteamVR_Controller.ButtonMask.ApplicationMenu))
        {
            holdTime = 0f;
        }


        if (device.GetHairTriggerUp() && currentHeld != null)
        {
            currentHeld.GetComponent <VRInteractableObject>().Release(this.gameObject);
            GetComponent <BoxCollider>().size = regularTriggerSize;
            currentHeld = null;
        }
    }
Exemple #18
0
    private IEnumerator AfterDeadedCoroutine()
    {
        // disable gui
        foreach (Canvas c in fullHacker.GetComponentsInChildren <Canvas>())
        {
            c.enabled = false;
        }

        // move player above the map
        float v = 1.0f;

        while (fadeOutPercentage < 1.0f)
        {
            fadeOutPercentage += Time.deltaTime * 0.5f;

            // accelerate and move upwards
            v += 25.0f * Time.deltaTime;
            fullHacker.transform.position += new Vector3(0, v * Time.deltaTime, 0);

            yield return(0);
        }

        // load end_of_game scene
        GameData.Instance.successfulHack = false;
        SteamVR_LoadLevel.Begin("end_of_game", false, 0.1f);
    }
    //The loading scheme for levels
    public static void LoadNextStage(int currentLevel)
    {
        string nextLevel = "";

        switch (currentLevel)
        {
        case 0:
            nextLevel = "Level1";
            break;

        case 1:
            nextLevel = "Level2";
            break;

        case 2:
            nextLevel = "Level3";
            break;

        case 3:
            nextLevel = "Level4";
            break;
        }

        SteamVR_LoadLevel.Begin(nextLevel);
    }
Exemple #20
0
    void OnCollisionEnter(Collision other)
    {
        if (other.gameObject.CompareTag("Throwable") && AreStarsAndGoalInActive())
        {
            switch (SceneManager.GetActiveScene().name)
            {
            case "Start":
                SteamVR_LoadLevel.Begin("level1");
                break;

            case "Level1":
                SteamVR_LoadLevel.Begin("level2");
                break;

            case "Level2":
                SteamVR_LoadLevel.Begin("level3");
                break;

            case "Level3":
                SteamVR_LoadLevel.Begin("level4");
                break;

            case "Level4":
                SteamVR_LoadLevel.Begin("WinScreen");
                break;

            default: Debug.Log("StartScreen");
                break;
            }
        }
    }
    public void OnTriggerEnter(Collider other)
    {
        if (other.CompareTag("Player"))
        {
            loadscreen = GameObject.FindGameObjectWithTag("LoadScreen");
            popup      = GameObject.FindGameObjectWithTag("PopupDiag");
            //print("portal collider hit");
            levelRestarted   = true;
            islevelrestarted = levelRestarted;

            if (GameModeScript.GameMode == 1)
            {
                // This is commented out TEMPORARILY for VR version- must change cstats.Save to make it work with the new system
                //cstats.Save();
            }

            if (LevelProgression.MasterLevelMultiplier == 2)
            {
                //loadscreen.gameObject.SetActive(true);
                //popup.gameObject.SetActive(true);
            }
            //VRTK_SDKManager.instance.enabled = false;
            GameObject.Find("RightController").GetComponent <AirsigPickaxe>().enabled = false;
            SteamVR_LoadLevel.Begin("testscene");

            //SceneManager.LoadScene("testscene");
        }
    }
    public void GotoMenu()
    {
        SoundManager.Instance.StopBGM();
        SteamVR_LoadLevel.Begin("menu");

        StartCoroutine(WaitForLoading(menuBGM));
    }
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.P))
     {
         SteamVR_LoadLevel.Begin("coffeAmir");
     }
 }
Exemple #24
0
 // Update is called once per frame
 void Update()
 {
     if (Input.anyKeyDown)
     {
         currLevel = (currLevel + 1) % 2;
         SteamVR_LoadLevel.Begin(levelNames[currLevel]);
     }
 }
Exemple #25
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.CompareTag("Throwable") && dsg.getCollectedStarts() == dsg.getNbStarsInGame())
     {
         collision.gameObject.GetComponent <Rigidbody>().velocity = Vector3.zero;
         SteamVR_LoadLevel.Begin(sceneLoading);
     }
 }
Exemple #26
0
    public void NextLevel()
    {
        string levelName = SceneManager.GetActiveScene().name;

        region.MarkLevelComplete(levelName);
        Save();
        SteamVR_LoadLevel.Begin(region.NextLevel(levelName));
    }
Exemple #27
0
    public void PlayerLose()
    {
        PlayerLost = true;
        LoseUI.SetActive(true);

        //Load Same Level
        SteamVR_LoadLevel.Begin("level1");
    }
Exemple #28
0
    public void PlayerWin()
    {
        PlayerWon = true;
        WinUI.SetActive(true);

        //Load Next Level
        SteamVR_LoadLevel.Begin("level2");
    }
Exemple #29
0
 public void startGame()
 {
     GameData.Instance.currentLevel = 1;
     if (!SteamVR_LoadLevel.loading)
     {
         SteamVR_LoadLevel.Begin("game");
     }
 }
Exemple #30
0
    private IEnumerator endGame()
    {
        // Do something when game ends.

        yield return(null);

        SteamVR_LoadLevel.Begin(_sceneToLoad);
    }