Created
July 20, 2012 13:29
-
-
Save anchan828/3150720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Test : MonoBehaviour | |
{ | |
//targetB | |
private Plane plane; | |
public Transform targetA; | |
void Start () | |
{ | |
plane = new Plane (transform.up, transform.position); | |
} | |
void Update () | |
{ | |
plane.SetNormalAndPosition (transform.up, transform.position); | |
if (plane.GetSide (target.position)) { | |
Debug.Log ("Up"); | |
} else { | |
Debug.Log ("Down"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment