当前位置: 首页>>代码示例>>C#>>正文


C# LevelManager.LoadLevel方法代码示例

本文整理汇总了C#中LevelManager.LoadLevel方法的典型用法代码示例。如果您正苦于以下问题:C# LevelManager.LoadLevel方法的具体用法?C# LevelManager.LoadLevel怎么用?C# LevelManager.LoadLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LevelManager的用法示例。


在下文中一共展示了LevelManager.LoadLevel方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Die

    void Die()
    {
        Destroy(this.gameObject);

        levelManager = GameObject.FindObjectOfType<LevelManager>();
        levelManager.LoadLevel("Game Over");
    }
开发者ID:jchoward206,项目名称:John_samples,代码行数:7,代码来源:PlayerController.cs

示例2: Start

 // Use this for initialization
 void Start()
 {
     text = GetComponentInChildren<Text>();
     button = GetComponent<Button>();
     levels = FindObjectOfType<LevelManager>();
     button.onClick.AddListener(() => levels.LoadLevel(song.SongName));
 }
开发者ID:AlexMaskill,项目名称:DissertationGame,代码行数:8,代码来源:LevelButton.cs

示例3: Start

	void Start()
	{
		levelMgr = LevelManager.Instance;
		levelMgr.LoadLevel(0);
		levelMgr.CurrentTimeline.GetComponent<TimeLine>().TimePeriodStarted += OnStart;
		levelMgr.CurrentTimeline.GetComponent<TimeLine>().TimePeriodEnded += OnEnd;
		levelMgr.CurrentTimeline.GetComponent<TimeLine>().TimerEnded += OnGate;
	}
开发者ID:JabberSnatch,项目名称:GGJ2016,代码行数:8,代码来源:TestController.cs

示例4: Update

 // Update is called once per frame
 void Update()
 {
     if (lives == -1){
         levelmanager = GameObject.FindObjectOfType<LevelManager>();
         levelmanager.LoadLevel("Lose Screen");
         lives = 3;
     }
 }
开发者ID:HackedLux,项目名称:Block-Breaker,代码行数:9,代码来源:LivesManager.cs

示例5: OnTriggerEnter2D

    void OnTriggerEnter2D(Collider2D collider)
    {
        Attacker attacker = collider.gameObject.GetComponent<Attacker>();

        //ignore if we're aren't colliding with an Attacker...
        // if the collider didn't have an Attacker component, it will return NULL
        if(attacker){
            Destroy(gameObject);
            levelManager = GameObject.FindObjectOfType<LevelManager>();
            levelManager.LoadLevel("03 Lose");
        }
    }
开发者ID:jchoward206,项目名称:John_samples,代码行数:12,代码来源:LoseTrigger.cs

示例6: OnTriggerEnter2D

 void OnTriggerEnter2D(Collider2D trigger)
 {
     //print("Trigger");
     // decrese lives until 0 then end
     levelManager=GameObject.FindObjectOfType<LevelManager>();
     textControl=GameObject.FindObjectOfType<TextController>();
     ball = GameObject.FindObjectOfType<Ball>();
     LevelManager.GameLives--;
     //Debug.Log (LevelManager.GameLives);
     if (LevelManager.GameLives <=0) {
         levelManager.LoadLevel("Lost Game");
     } else {
         ball.BallReset();
         textControl.PrintLivesLeft();
     }
 }
开发者ID:finian826,项目名称:Block-Buster,代码行数:16,代码来源:LoseCollider.cs

示例7: Awake

    void Awake()
    {
        //Find only active objects
        gui = FindObjectOfType<GuiManager>();
        hero = FindObjectOfType<HeroScript>();
        level = FindObjectOfType<LevelManager>();

        hero.gameObject.SetActive(false);

        //Find all objects(active, inactive, prefab, assets)
        //var h = Resources.FindObjectsOfTypeAll<HeroScript>();

        gui.StartRequest += StartApplication;
        gui.QuitRequest += QuitApplication;
        gui.PauseRequest += level.PauseLevel;
        gui.PlayRequest += level.PlayLevel;
        gui.RestartRequest += level.RestartLevel;
        gui.LoadRequest += level.LoadLevel;
        gui.DiedRequest += () => level.LoadLevel(1);
        gui.LoadMenuRequest += () =>
        {
            Destroy(FindObjectOfType<CameraScript>());
            Destroy(gui.gameObject);
            Destroy(hero.gameObject);
            Destroy(this.gameObject);
            level.LoadLevel(0);
        };
        gui.LevelRequest += level.NextLevel;
        gui.LastLevelRequest += level.IsLastLevel;

        hero.ChangeCountHeartsRequest += gui.DrawHearts;
        hero.FinishLevel += gui.FinishLevelClick;
        hero.AwakeRequest += level.PauseLevel;
        hero.LoadRequest += level.PlayLevel;
        hero.DiedRequest += gui.DieClick;
    }
开发者ID:GeorgeAlexandria,项目名称:PlatformerGame,代码行数:36,代码来源:ApplicationManager.cs

示例8: OnCollisionEnter2D

	void OnCollisionEnter2D(Collision2D collision) {
		Debug.Log ("Collision on BottomCollider detected.");
		levelManager = GameObject.FindObjectOfType<LevelManager>();
		levelManager.LoadLevel ("Lose Screen");
	}
开发者ID:J4ybird,项目名称:BlockBreaker,代码行数:5,代码来源:BottomCollider.cs

示例9: OnTriggerEnter2D

	void OnTriggerEnter2D (Collider2D ball_collider) {
		level_Manager = GameObject.FindObjectOfType<LevelManager>();
		level_Manager.LoadLevel("Lose");
	}
开发者ID:terrysky18,项目名称:BlockBreaker_game,代码行数:4,代码来源:LoseCollider.cs

示例10: Start

 void Start()
 {
     lm = GameObject.FindWithTag("LevelManager").GetComponent<LevelManager>();
     lm.LoadLevel(levelName);
 }
开发者ID:matyicsapo,项目名称:Duality,代码行数:5,代码来源:GameStuff.cs

示例11: OnTriggerEnter2D

 void OnTriggerEnter2D(Collider2D trigger)
 {
     levelManager = GameObject.FindObjectOfType<LevelManager>();
     levelManager.LoadLevel("Lose Screen");
 }
开发者ID:bl2i4n,项目名称:UnityBlockBreaker,代码行数:5,代码来源:LoseCollider.cs

示例12: Redirect

 private void Redirect()
 {
     GlobalVariables.GoBackToGame = true;
     LevelManager levelManager = new LevelManager();
     levelManager.LoadLevel(SceneBook.DECK_CREATOR_NAME);
 }
开发者ID:gabrielamboss,项目名称:Ulkoa,代码行数:6,代码来源:RedirectToEdit.cs

示例13: OnTriggerEnter2D

	void OnTriggerEnter2D (Collider2D collider) {
		scoreManager =  FindObjectOfType<ScoreManager>();
		scoreManager.ComboBreaker();
		levelManger = FindObjectOfType<LevelManager>();
		levelManger.LoadLevel("Lose Screen");
	}
开发者ID:NickBellamy,项目名称:Block-Breaker,代码行数:6,代码来源:LoseCollider.cs

示例14: OnCollisionEnter2D

	void OnCollisionEnter2D (Collision2D collision){
		levelManager = GameObject.FindObjectOfType<LevelManager>();
		levelManager.LoadLevel("Lose");
	}
开发者ID:jogee489,项目名称:BlockBreaker,代码行数:4,代码来源:LoseCollider.cs


注:本文中的LevelManager.LoadLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。