Example #1
0
 public void Awake()
 {
     if(_instance != null) {
         Destroy(gameObject);
     } else {
         _instance = this;
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
Example #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();
 }