Small bash script to that helps you to clean up things 1 2 3 4 5 6 7 8 9 10 11 12 #!/bin/bash for br in $( git for -each-ref --count = 30 --sort = -committerdate refs/heads/ --format = '%(refname:short)' ) ; do echo "Delete branch $br (y/n)?" read -rsn1 input if [ "$input" = "y" ] ; then echo "deleting $br" git br -D $br else echo "skip $br" fi done
I was trying to check when enemy ships are getting out of screen to destroy objects (optimization). First version Vector2 screenSize = new Vector3 (Screen.width, Screen.height, Mathf.Abs (Camera.main.transform.position.z)); Bounds screenBounds = new Bounds (new Vector2(0f,0f), screenSize); Debug.Log ("Ship " + ship.renderer.bounds + " Screen " + screenBounds); if (!ship.renderer.bounds.Intersects (screenBounds)) ship.Destroy (); So apparently this operation is taking significant time to check, end up replacing with this Vector3 screenPos = Camera.main.WorldToScreenPoint( ship.transform.position ); Vector3 screenSize = Camera.main.WorldToScreenPoint( ship.renderer.bounds.size); if (screenPos.x + screenSize.x < 0) ship.Destroy ();