Skip to content

Instantly share code, notes, and snippets.

@lycoris102
Last active August 29, 2015 14:24
Show Gist options
  • Save lycoris102/cfa7c2244c40565e5073 to your computer and use it in GitHub Desktop.
Save lycoris102/cfa7c2244c40565e5073 to your computer and use it in GitHub Desktop.
using System;
using System.Collections;
using UnityEngine;
using UniRx;
using UniRx.Triggers;
public class GameOver : MonoBehaviour {
void Start () {
// プレイヤーが触れたらリトライさせる
this.OnTriggerEnter2DAsObservable()
.Where(x => x.gameObject.tag == "Player")
.Subscribe(x => {
Application.LoadLevel("main");
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment