private void CreateParticles() { GameObject inst = Instantiate(particlesPrefab, transform, false); RectTransform particlesTransform = inst.GetComponent <RectTransform>(); particlesTransform.anchoredPosition = new Vector2(131, -147); var basePlayerView = FindObjectOfType <BasePlayerView>(); if (!basePlayerView) { Destroy(inst); } else { particlesTransform.SetParent(basePlayerView.progressParticles.transform.parent, true); particlesTransform.GetComponent <BezierMover>().Setup(AnimUtils.GetBezierQubicData(particlesTransform.GetComponent <RectTransformPositionObject>(), start: particlesTransform.anchoredPosition, end: basePlayerView.progressParticles.GetComponent <RectTransform>().anchoredPosition, interval: 1.5f, onComplete: (go) => { Services.Execute(() => Destroy(inst), 0.5f); })); } }