private IEnumerator SetupImpl(StoreItemSection section) { yield return(new WaitUntil(() => asyncLoader.gameObject.activeSelf && asyncLoader.gameObject.activeInHierarchy)); asyncLoader.ActivateItems(() => { print("activated completed"); var scrollData = new FloatAnimationData { StartValue = scrollRect.verticalNormalizedPosition, EndValue = sectionPoints[section], Duration = GetAnimationInterval(GetDistance(section)), AnimationMode = BosAnimationMode.Single, EaseType = EaseType.EaseInOutQuad, Target = scrollRect.gameObject, OnStart = (v, o) => scrollRect.verticalNormalizedPosition = v, OnUpdate = (v, t, o) => scrollRect.verticalNormalizedPosition = v, OnEnd = (v, o) => scrollRect.verticalNormalizedPosition = v }; animator.StartAnimation(scrollData); }); }
public void Setup(StoreItemSection section) { Services.RunCoroutine(SetupImpl(section)); }
public StoreItemAvailability(StoreItemStore store, float pricePerQuantity, StoreItemSection defaultSection) { Store = store; PricePerQuantity = pricePerQuantity; DefaultSection = defaultSection; }
private float GetDistance(StoreItemSection section) { return(sectionPoints[section] - scrollRect.verticalNormalizedPosition); }
public void ChangeDefaultSection(StoreItemSection section) { DefaultSection = section; }