| | |
| | | uieff.Play();
|
| | | }
|
| | |
|
| | | if (rect == null)
|
| | | {
|
| | | if (startPos == new Vector2(10000, 10000))
|
| | | {
|
| | | //避免多次随机
|
| | | startPos = new Vector2(UnityEngine.Random.Range(-150, 150), UnityEngine.Random.Range(-150, 150));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | //startPos的位置进行范围随机
|
| | | startPos = new Vector2(rect.localPosition.x + UnityEngine.Random.Range(-60, 60), rect.localPosition.y + UnityEngine.Random.Range(-60, 60));
|
| | | }
|
| | | |
| | | this.transform.position = rect.position;
|
| | | startPos = new Vector2(transform.localPosition.x + UnityEngine.Random.Range(-30, 30), transform.localPosition.y + UnityEngine.Random.Range(50, 100));
|
| | | if (isAnimate)
|
| | | {
|
| | | isPlaying = true;
|