public Animotion.Animotion ScaleUpAndDownBannerAnimotion(RectTransform bannerRect) { 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 GameObjectSetActiveConfigureContainer setActiveTrueContainer = new GameObjectSetActiveConfigureContainer(bannerRect.gameObject, true); ConfigureAnimotion setActiveConfigure = new ConfigureAnimotion(setActiveTrueContainer, 1, true); configureAnimotion.Add(setActiveConfigure); // REPRODUCE LA TWEEN Animotion.Animotion motionTweenScaleUp = new ScaleRectTweenAnimotion(this, 2, bannerRect, finalScale); motionsSpawn.Add(motionTweenScaleUp); Animotion.Animotion motionTweenScaleDown = new ScaleRectTweenAnimotion(this, 3, bannerRect, normalScale); motionsSpawn.Add(motionTweenScaleDown); // SE DESACTIVA GameObjectSetActiveConfigureContainer setActiveFalseContainer = new GameObjectSetActiveConfigureContainer(bannerRect.gameObject, false); ConfigureAnimotion setActiveFalseConfigure = new ConfigureAnimotion(setActiveFalseContainer, 4, true); configureAnimotion.Add(setActiveFalseConfigure); CombineAnimotion combinMoveMotion = new CombineAnimotion(this, 1, motionsSpawn, configureAnimotion); return(combinMoveMotion); }
public Animotion OnCardSendToGraveyardAnimotion(RectTransform cardRect, int PlayerID) { Vector3 finalScale = new Vector3(0.2f, 0.2f, 1); List <Animotion> motionsWaitToGraveyard = new List <Animotion>(); Animotion motionTweenScaleUp = new ScaleRectTweenAnimotion(this, 1, cardRect, finalScale, 1); motionsWaitToGraveyard.Add(motionTweenScaleUp); Vector3 finalCardPosition = playerOneGraveyardLogo.position; if (PlayerID == 0) { finalCardPosition = playerOneGraveyardLogo.position; } else { finalCardPosition = playerTwoGraveyardLogo.position; } Animotion motionTweenSpawn = new SpawnCardTweenAnimotion(this, 1, cardRect, finalCardPosition, 2); motionsWaitToGraveyard.Add(motionTweenSpawn); // tengo que setear el parent List <ConfigurableMotion> configurables = new List <ConfigurableMotion>(); RectTransform parentTransform = null; if (PlayerID == 0) { parentTransform = playerOneGraveyard; } else { parentTransform = playerTwoGraveyard; } ChildParentConfigureContainer parentContainer = new ChildParentConfigureContainer(parentTransform, cardRect); ConfigureAnimotion parentChildConfigAnimotion = new ConfigureAnimotion(parentContainer, 3); configurables.Add(parentChildConfigAnimotion); //SetCanvasGroupBlockRaycastConfigureAnimotion<MikzeerGame.CardUI, Transform> blockRayCastConfigAnimotion // = new SetCanvasGroupBlockRaycastConfigureAnimotion<MikzeerGame.CardUI, Transform>(cardUI, GameCreator.Instance.playerOneGraveyard, 4); //configurables.Add(blockRayCastConfigAnimotion); CombineAnimotion combineSendToGraveyardMotion = new CombineAnimotion(this, 1, motionsWaitToGraveyard, configurables); return(combineSendToGraveyardMotion); }
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); }
public Animotion AddCardAnimotion(GameObject createdCardGameObject, int PlayerID) { Vector3 normalScale = createdCardGameObject.transform.localScale; Vector3 startScale = new Vector3(0.2f, 0.2f, 1); createdCardGameObject.transform.localScale = startScale; // hacerla animacion de instanciamiento a la mano y saliendo un poco de la pantalla List <Animotion> motionsSpawn = new List <Animotion>(); RectTransform cardRect = createdCardGameObject.GetComponent <RectTransform>(); Animotion motionTweenScaleUp = new ScaleRectTweenAnimotion(this, 1, cardRect, normalScale, 1); motionsSpawn.Add(motionTweenScaleUp); Vector3 finalCardPosition = Vector3.zero; if (PlayerID == 0) { if (cardHolderPlayerLeft.transform.childCount > 0) { finalCardPosition = cardHolderPlayerLeft.GetChild(cardHolderPlayerLeft.childCount - 1).position; } else { finalCardPosition = cardHolderPlayerLeft.position; } } else { if (cardHolderPlayerRight.transform.childCount > 0) { finalCardPosition = cardHolderPlayerRight.GetChild(cardHolderPlayerRight.childCount - 1).position; } else { finalCardPosition = cardHolderPlayerRight.position; } } Animotion motionTweenSpawn = new SpawnCardTweenAnimotion(this, 1, createdCardGameObject.transform, finalCardPosition, 2); motionsSpawn.Add(motionTweenSpawn); // tengo que setear el parent List <ConfigurableMotion> configurables = new List <ConfigurableMotion>(); ChildParentConfigureContainer parentContainer = null; if (PlayerID == 0) { parentContainer = new ChildParentConfigureContainer(cardHolderPlayerLeft, createdCardGameObject.transform); } else { parentContainer = new ChildParentConfigureContainer(cardHolderPlayerRight, createdCardGameObject.transform); } ConfigureAnimotion parentChildConfigAnimotion = new ConfigureAnimotion(parentContainer, 3, true); configurables.Add(parentChildConfigAnimotion); CardInGameUINEW cardInGameUI = createdCardGameObject.GetComponent <CardInGameUINEW>(); // activamos el canvas group para que pueda recibir raycast otra vez SetCanvasGroupBlockRaycastConfigureContainer canvasBlockRayContainer = new SetCanvasGroupBlockRaycastConfigureContainer(cardInGameUI, true); ConfigureAnimotion blackRayCastConfigAnimotion = new ConfigureAnimotion(canvasBlockRayContainer, 4, true); configurables.Add(blackRayCastConfigAnimotion); CombineAnimotion combineMoveMotion = new CombineAnimotion(this, 1, motionsSpawn, configurables); return(combineMoveMotion); }