mirror of
https://github.com/chibicitiberiu/frica-de-gaze
synced 2024-02-24 08:23:32 +00:00
Revert "-"
This reverts commit 9819dda592.
Conflicts:
FricaDeGaze/Library/CurrentLayout.dwlt
FricaDeGaze/Library/assetDatabase3
FricaDeGaze/Library/expandedItems
This commit is contained in:
Binary file not shown.
@@ -2,19 +2,33 @@
|
||||
using System.Collections;
|
||||
|
||||
public class misca2 : MonoBehaviour {
|
||||
|
||||
|
||||
public Transform target;
|
||||
IEnumerator Start () {
|
||||
//yield return new WaitForSeconds (0.2f);
|
||||
//float width = camera.pixelWidth;
|
||||
Vector3 dis = transform.position - target.position;
|
||||
float xpos = Random.Range (-dis.x, dis.x);
|
||||
while (xpos+dis.x > target.position.x || xpos+dis.x < -target.position.x )
|
||||
xpos = Random.Range (-target.position.x, target.position.x);
|
||||
float zpos = Random.Range (-target.position.z, target.position.z);
|
||||
while (zpos+dis.z > target.position.z)
|
||||
zpos = Random.Range (-target.position.z, target.position.z);
|
||||
|
||||
Vector3 position = new Vector3(Random.Range(-5.0F, 5.0F), 0, Random.Range(-5.0F, 5.0F));
|
||||
Vector3 position = new Vector3(xpos, 0, zpos);
|
||||
//transform.TransformVector (new Vector3(target.position.x,target.position.y,target.position));
|
||||
|
||||
Vector3 pointA = transform.position;
|
||||
Vector3 pointB = pointA + new Vector3 (0.5f,0,0.5f);
|
||||
//Vector3 pointB = pointA + new Vector3 (0.5f,0,0.5f);
|
||||
while (true) {
|
||||
yield return StartCoroutine(MoveObject(transform, pointA, position, 1.5f));
|
||||
yield return StartCoroutine(MoveObject(transform, position, pointA, 1.5f));
|
||||
position = new Vector3(Random.Range(-5.0F, 5.0F), 0, Random.Range(-5.0F, 5.0F));
|
||||
while (xpos > target.position.x)
|
||||
xpos = Random.Range (-target.position.x, target.position.x);
|
||||
while (zpos > target.position.z || zpos< -target.position.z)
|
||||
zpos = Random.Range (-target.position.z, target.position.z);
|
||||
position.x = xpos;
|
||||
position.y = zpos;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user