/*public AnimationCollector(List<AnimationUI> animations,RectTransform target) * { * foreach (var ani in animations) * animationList.Add * }*/ public AnimationCollector(AnimationCollector source) { isForward = source.IsForward; foreach (var ani in source.AnimationList) { animationList.Add(new AnimationBase(ani)); } }
public void Initialize(GameObject target) { if (!isInitialized) { isInitialized = true; aniTarget = target.GetComponent <RectTransform>(); var anime = target.GetComponents <AnimationUI>(); animationCollector = new AnimationCollector(anime.Select(x => x.UiAnimation).ToList(), aniTarget); animationList = new List <AnimationUI>(); animationList.AddRange(anime); } }
public IEnumerator Initialize() { if (!isInitialized) { isInitialized = true; if (aniTarget == null) { aniTarget = GetComponent <RectTransform>(); } var anime = GetComponents <AnimationUI>(); animationList = new List <AnimationUI>(); animationList.AddRange(anime); foreach (var ani in animationList) { ani.Initialize(); } animationCollector = new AnimationCollector(anime.Select(x => x.UiAnimation).ToList(), aniTarget); } isReady = false; yield break; }
void CreateCollector() { for (int i = 0; i < animationUIList.Count; i++) { var animeUI = animationUIList[i]; animationList.Add(animeUI.UiAnimation); } if (targetList == null) { targetList = new List <RectTransform>(); } for (int i = 0; i < targetList.Count; i++) { AnimationCollector aniCollector = new AnimationCollector(animationList, targetList[i]); collectorList.Add(aniCollector); if (delayList.Count <= i) { delayList.Add(0); } } }