private void OnDestroy() { BubblesPlayer.Instance.ChangeScoreEvent -= SetScore; BubblesPlayer.Instance.ChangeStarsEvent -= SetStars; ts.Break(); SimpleTween.Cancel(gameObject, false); SimpleTween.Cancel(starRightFull.gameObject, false); SimpleTween.Cancel(starLeftFull.gameObject, false); SimpleTween.Cancel(starMiddleFull.gameObject, false); }
private void OnDestroy() { if (MPlayer) { MPlayer.ChangeScoreEvent -= SetScore; } if (MPlayer) { MPlayer.ChangeStarsEvent -= SetStars; } if (ts != null) { ts.Break(); } SimpleTween.Cancel(gameObject, false); SimpleTween.Cancel(starRightFull, false); SimpleTween.Cancel(starLeftFull, false); SimpleTween.Cancel(starMiddleFull, false); }
private IEnumerator SetMapPositionToAciveButton() { yield return(new WaitForSeconds(0.1f)); if (sRect) { int bCount = biomesCount; float contentSizeY = content.sizeDelta.y / (bCount) * (bCount - 1.0f); float relPos = content.InverseTransformPoint(ActiveButton.transform.position).y; // Debug.Log("contentY : " + contentSizeY + " ;relpos : " + relPos + " : " + relPos / contentSizeY); float vpos = (-contentSizeY / (bCount * 2.0f) + relPos) / contentSizeY; // SimpleTween.Cancel(gameObject, false); float start = sRect.verticalNormalizedPosition; SimpleTween.Value(gameObject, start, vpos, 0.25f).SetOnUpdate((float f) => { sRect.verticalNormalizedPosition = Mathf.Clamp01(f); }); //sRect.verticalNormalizedPosition = Mathf.Clamp01(vpos); // Debug.Log("vpos : " + Mathf.Clamp01(vpos)); } else { Debug.Log("no scrolling rect"); } }