Nextrek
Diff Revisions
133
vs
134
for /3DSpace/Assets/Custum/Scripts/DrawRect.cs
|
@@ -3,8 +3,6 @@ |
3 |
3 |
|
|
4 |
4 |
|
public class DrawRect : MonoBehaviour |
5 |
5 |
|
{ |
6 |
|
- |
public Transform start; |
7 |
|
- |
public Transform end; |
8 |
6 |
|
public Color rectColor; |
9 |
7 |
|
public Color textColor; |
10 |
8 |
|
|
|
@@ -81,14 +79,9 @@ |
81 |
79 |
|
void OnGUI() |
82 |
80 |
|
{ |
83 |
81 |
|
|
84 |
|
- |
if(start==null|end==null) |
85 |
|
- |
{ |
86 |
|
- |
return; |
87 |
|
- |
} |
88 |
|
- |
|
89 |
82 |
|
if(Camera.main) |
90 |
83 |
|
{ |
91 |
|
- |
Vector3 cen = Camera.main.WorldToScreenPoint((start.position+end.position)/2); |
|
84 |
+ |
Vector3 cen = Camera.main.WorldToScreenPoint(this.transform.position); |
92 |
85 |
|
|
93 |
86 |
|
if (cen.z>0) { |
94 |
87 |
|
|