本文整理汇总了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");
}
示例2: Start
// Use this for initialization
void Start()
{
text = GetComponentInChildren<Text>();
button = GetComponent<Button>();
levels = FindObjectOfType<LevelManager>();
button.onClick.AddListener(() => levels.LoadLevel(song.SongName));
}
示例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;
}
示例4: Update
// Update is called once per frame
void Update()
{
if (lives == -1){
levelmanager = GameObject.FindObjectOfType<LevelManager>();
levelmanager.LoadLevel("Lose Screen");
lives = 3;
}
}
示例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");
}
}
示例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();
}
}
示例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;
}
示例8: OnCollisionEnter2D
void OnCollisionEnter2D(Collision2D collision) {
Debug.Log ("Collision on BottomCollider detected.");
levelManager = GameObject.FindObjectOfType<LevelManager>();
levelManager.LoadLevel ("Lose Screen");
}
示例9: OnTriggerEnter2D
void OnTriggerEnter2D (Collider2D ball_collider) {
level_Manager = GameObject.FindObjectOfType<LevelManager>();
level_Manager.LoadLevel("Lose");
}
示例10: Start
void Start()
{
lm = GameObject.FindWithTag("LevelManager").GetComponent<LevelManager>();
lm.LoadLevel(levelName);
}
示例11: OnTriggerEnter2D
void OnTriggerEnter2D(Collider2D trigger)
{
levelManager = GameObject.FindObjectOfType<LevelManager>();
levelManager.LoadLevel("Lose Screen");
}
示例12: Redirect
private void Redirect()
{
GlobalVariables.GoBackToGame = true;
LevelManager levelManager = new LevelManager();
levelManager.LoadLevel(SceneBook.DECK_CREATOR_NAME);
}
示例13: OnTriggerEnter2D
void OnTriggerEnter2D (Collider2D collider) {
scoreManager = FindObjectOfType<ScoreManager>();
scoreManager.ComboBreaker();
levelManger = FindObjectOfType<LevelManager>();
levelManger.LoadLevel("Lose Screen");
}
示例14: OnCollisionEnter2D
void OnCollisionEnter2D (Collision2D collision){
levelManager = GameObject.FindObjectOfType<LevelManager>();
levelManager.LoadLevel("Lose");
}