コード例 #1
0
ファイル: FlippyMusic.cs プロジェクト: Beanalby/1GameAMonth14
 public void Awake()
 {
     if(_instance != null) {
         Destroy(gameObject);
     } else {
         _instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     bool debug = false;
     if(debug) {
         collider2D.enabled = false;
         xSpeed = 9;
         gravity = 0f;
     }
     cam = Camera.main;
     rigidbody2D.gravityScale = gravity;
     rigidbody2D.velocity = new Vector2(xSpeed, 0);
     transform.rotation = Quaternion.Euler(new Vector3(0, 0, 45));
     music = GameObject.FindObjectOfType<FlippyMusic>();
     Jump();
 }