public Animotion.Animotion ShowBannerForAmountOfTimeThenCloseAnimotion(RectTransform bannerRectTimer, float duration) { List <Animotion.Animotion> motionsSpawn = new List <Animotion.Animotion>(); List <ConfigurableMotion> configureAnimotion = new List <ConfigurableMotion>(); // SE ACTIVA GameObjectSetActiveConfigureContainer setActiveTrueContainer = new GameObjectSetActiveConfigureContainer(bannerRectTimer.gameObject, true); ConfigureAnimotion setActiveConfigure = new ConfigureAnimotion(setActiveTrueContainer, 1, true); configureAnimotion.Add(setActiveConfigure); // REPRODUCE LA TWEEN Animotion.Animotion motionTimer = new TimeAnimotion(this, 2, duration); motionsSpawn.Add(motionTimer); // SE DESACTIVA GameObjectSetActiveConfigureContainer setActiveFalseContainer = new GameObjectSetActiveConfigureContainer(bannerRectTimer.gameObject, false); ConfigureAnimotion setActiveFalseConfigure = new ConfigureAnimotion(setActiveFalseContainer, 4, true); configureAnimotion.Add(setActiveFalseConfigure); CombineAnimotion combinMoveMotion = new CombineAnimotion(this, 1, motionsSpawn, configureAnimotion); return(combinMoveMotion); }
public Animotion.Animotion ShowBannerScaleUpWaitForTimeScaleDownCloseAnimotion(RectTransform bannerRect, float duration) { List <Animotion.Animotion> motionsSpawn = new List <Animotion.Animotion>(); List <ConfigurableMotion> configureAnimotion = new List <ConfigurableMotion>(); // ACTUAL SCALE / NEW SCALE Vector3 normalScale = bannerRect.localScale; Vector3 finalScale = new Vector3(1.2f, 1.2f, 1); // SE ACTIVA ORDER 1 GameObjectSetActiveConfigureContainer setActiveTrueContainer = new GameObjectSetActiveConfigureContainer(bannerRect.gameObject, true); ConfigureAnimotion setActiveConfigure = new ConfigureAnimotion(setActiveTrueContainer, 1, true); configureAnimotion.Add(setActiveConfigure); // REPRODUCE LA TWEEN DE SCALE UP ORDER 2 Animotion.Animotion motionTweenScaleUp = new ScaleRectTweenAnimotion(this, 2, bannerRect, finalScale, 1); motionsSpawn.Add(motionTweenScaleUp); // ESPERAMOS ORDER 3 Animotion.Animotion motionTimer = new TimeAnimotion(this, 3, duration); motionsSpawn.Add(motionTimer); // REPRODUCE LA TWEEN DE SCALE DOWN ORDER 4 Animotion.Animotion motionTweenScaleDown = new ScaleRectTweenAnimotion(this, 4, bannerRect, normalScale, 1); motionsSpawn.Add(motionTweenScaleDown); // SE DESACTIVA ORDER 5 GameObjectSetActiveConfigureContainer setActiveFalseContainer = new GameObjectSetActiveConfigureContainer(bannerRect.gameObject, false); ConfigureAnimotion setActiveFalseConfigure = new ConfigureAnimotion(setActiveFalseContainer, 5, true); configureAnimotion.Add(setActiveFalseConfigure); CombineAnimotion combinMoveMotion = new CombineAnimotion(this, 1, motionsSpawn, configureAnimotion); return(combinMoveMotion); }