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.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);
            }
Example #4
0
        public Animotion NormalSpawnAnimotion(Vector3 tileObjectRealWorldLocation, GameObject goKimbok)
        {
            List <Animotion>          motionsSpawn       = new List <Animotion>();
            List <ConfigurableMotion> configureAnimotion = new List <ConfigurableMotion>();

            //A CRANE//GRUA SET ACTIVE = TRUE
            Crane.SetActive(true);

            // POSICION INICIAL Y FINAL DE LA GRUA PARA TWEENEAR
            Vector3 craneStartPosition;
            Vector3 craneEndPostion;

            //B TWEEN DESDE UNA POSICION ELEVADA SOBRE LA TILE DONDE SE INDICO SPAWNEAR HASTA MAS ABAJO ASI SE VE DESDE ARRIBA EN EL TABLERO SOBRE LA TILE
            craneStartPosition = new Vector3(tileObjectRealWorldLocation.x, craneStartPositionY, 0);
            PositionVector3ConfigureContainer posVectContainer = new PositionVector3ConfigureContainer(craneStartPosition, Crane.transform);
            ConfigureAnimotion posVectConfigure = new ConfigureAnimotion(posVectContainer, 1);

            configureAnimotion.Add(posVectConfigure);

            craneEndPostion = new Vector3(tileObjectRealWorldLocation.x, Helper.GetCameraTopBorderYWorldPostion().y);

            Vector3 craneSpawnPosition = CraneEnd.position;

            // ACTIVAMOS AL KIMBOKO SINO NO PUEDE OBTENER EL CURRENT ANIMATOR STATE INFO
            goKimbok.SetActive(true);

            goKimbok.transform.position = craneSpawnPosition;

            // TWEEN DE LA CRANE A LA POSICION DE SPAWNEO
            Animotion motionTweenMove = new MoveTweenAnimotion(this, 2, Crane.transform, craneEndPostion, craneTweenSpeedVelocity);

            motionsSpawn.Add(motionTweenMove);

            ////C ANIMATION CRANESPAWNING
            Animotion motionCraneSpawn = new SpawnAnimatedAnimotion(this, 3, craneAnimator);

            motionsSpawn.Add(motionCraneSpawn);

            if (GameSoundManager.Instance != null && GameSoundManager.Instance.audioSource != null)
            {
                AudioSourceParameter audioParameter   = new AudioSourceParameter(true); // false
                Animotion            motionSpawnSound = new SoundAnimotion(this, 3, GameSoundManager.Instance.audioSource, GameSoundManager.Instance.audioClips[3], audioParameter);
                motionsSpawn.Add(motionSpawnSound);
            }

            PositionTransformConfigureContainer posTransformContainer = new PositionTransformConfigureContainer(goKimbok.transform, CraneEnd);
            ConfigureAnimotion posTransformConfigure = new ConfigureAnimotion(posTransformContainer, 4);

            configureAnimotion.Add(posTransformConfigure);

            GameObjectSetActiveConfigureContainer setActiveContainer = new GameObjectSetActiveConfigureContainer(goKimbok, true);
            ConfigureAnimotion setActiveConfigure = new ConfigureAnimotion(setActiveContainer, 4, true);

            configureAnimotion.Add(setActiveConfigure);


            ////E TWEEN DESDE LA PUNTA DEL CRANE HASTA EL PISO, DE LA MISMA DURACION QUE LA ANIMACION DE SPAWN
            Animotion motionKimbokoTweenMove = new MoveTweenAnimotion(this, 5, goKimbok.transform, tileObjectRealWorldLocation, kimbokoTweenSpeedVelocity);

            motionsSpawn.Add(motionKimbokoTweenMove);
            //G TWEEN DE LA CRANE PARA QUE SALGA DEL MAPA
            Animotion motionTweenBackCraneMove = new MoveTweenAnimotion(this, 6, Crane.transform, craneStartPosition, craneTweenSpeedVelocity);

            motionsSpawn.Add(motionTweenBackCraneMove);

            // FINISH //



            SetTriggerAnimationCongifureContainer setIdlleKimbokoContainer = new SetTriggerAnimationCongifureContainer(goKimbok.GetComponent <Animator>(), "Idlle");
            ConfigureAnimotion idlleKimbokoConfigure = new ConfigureAnimotion(setIdlleKimbokoContainer, 7, true);

            configureAnimotion.Add(idlleKimbokoConfigure);
            SetTriggerAnimationCongifureContainer setIdlleCraneContainer = new SetTriggerAnimationCongifureContainer(craneAnimator, "Idlle");
            ConfigureAnimotion idlleCraneConfigure = new ConfigureAnimotion(setIdlleCraneContainer, 7, true);

            configureAnimotion.Add(idlleCraneConfigure);
            //Animotion motionIdlleKimboko = new IdlleAnimatedAnimotion(this, 7, goKimbok.GetComponent<Animator>());
            //motionsSpawn.Add(motionIdlleKimboko);

            //Animotion motionIdlleCrane = new IdlleAnimatedAnimotion(this, 7, craneAnimator);
            //motionsSpawn.Add(motionIdlleCrane);

            CombineAnimotion spawnMotion = new CombineAnimotion(this, 1, motionsSpawn, configureAnimotion);

            // LO DESACTIVO PARA QUE NO MOLESTE EN ESCENA ANTES DE "SPAWNEARSE"
            goKimbok.SetActive(false);

            return(spawnMotion);
        }