コード例 #1
0
 // when the player runs into an object, they will be reset at the top of
 // the screen, with gravity reset.
 //TODO: clean this function up, tints player two times
 void RunIntoObject()
 {
     this.AddCharisma(-10f);
     rb.velocity             = Vector2.zero;
     this.transform.position =
         Physics2D.gravity.y < 0 ? new Vector3(transform.position.x, MAX_HEIGHT - .1f, 0) : new Vector3(transform.position.x, MIN_HEIGHT + .1f, 0);
     FindObjectOfType <AudioManager>().Play("negative");
     ResultsManager.IncPlayerCrash();
 }