Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
RandomPositionMover.cs
Go to the documentation of this file.
1using UnityEngine;
2
3public class RandomPositionMover : MonoBehaviour
4{
5 public float pickerInterval;
6
7 public float radius;
8
9 public GameObject player;
10
11 public Vector2 randomPointInCircle;
12
13 private void Start()
14 {
15 if (pickerInterval == 0f)
16 {
17 pickerInterval = 3f;
18 }
19 randomPointInCircle = Vector2.zero;
20 InvokeRepeating("PickRandomPointInCircle", Random.Range(0f, pickerInterval), pickerInterval);
21 }
22
24 {
25 base.transform.position = player.transform.position;
26 randomPointInCircle = (Vector2)base.transform.localPosition + Random.insideUnitCircle * radius;
27 base.transform.localPosition = randomPointInCircle;
28 }
29
30 private void Update()
31 {
32 }
33}