public static void FaceRight(PlayerBhv bhv, bool right) { if (bhv.facingRight != right) { Flip(bhv); } }
public static void Flip(PlayerBhv player) { player.facingRight = !player.facingRight; Vector3 theScale = player.transform.localScale; theScale.x *= -1; player.transform.localScale = theScale; }
void Start() { if (m_Target == null) { m_Target = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBhv>(); } vertExtent = Camera.main.orthographicSize; horzExtent = vertExtent * Screen.width / Screen.height; }