public override void Tick() { if (moveSettings == null) { moveSettings = MoveRandomInCircleSettings.Default; } mob.transform.Translate(Vector3.forward * moveSettings.speed * 10 * Time.fixedDeltaTime); mob.transform.Rotate(Vector3.up, UnityEngine.Random.Range(-moveSettings.angle, moveSettings.angle)); if (moveSettings.range < mob.transform.position.magnitude) { mob.transform.LookAt(Vector3.zero); } }
public void Init(MoveRandomInCircleSettings settings) { moveSettings = settings; }