Esempio n. 1
0
 public static void FaceRight(PlayerBhv bhv, bool right)
 {
     if (bhv.facingRight != right)
     {
         Flip(bhv);
     }
 }
Esempio n. 2
0
    public static void Flip(PlayerBhv player)
    {
        player.facingRight = !player.facingRight;
        Vector3 theScale = player.transform.localScale;

        theScale.x *= -1;
        player.transform.localScale = theScale;
    }
Esempio n. 3
0
 void Start()
 {
     if (m_Target == null)
     {
         m_Target = GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerBhv>();
     }
     vertExtent = Camera.main.orthographicSize;
     horzExtent = vertExtent * Screen.width / Screen.height;
 }