Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1.     void OnCollisionStay2D(Collision2D target)
  2.         {
  3.             if (target.gameObject.tag != "ground")
  4.             {
  5.                 isWalkable = false;
  6.             //<condition> ? value to use if true : value to use if false
  7.                 monster.rigidbody2D.transform.localScale = new Vector3((transform.localScale.x == 1) ? -1 : 1, 1, 1);
  8.                 Debug.Log ("Tile is not walkable");
  9.             }
  10.             else
  11.             {
  12.                 isWalkable = true;
  13.                 Debug.Log("Tile walkable");
  14.             }
  15.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement