public StarEffect2D(IObject2DFactory factory, ALayer2D parentLayer, CardEntityAwakenedDecorator2D parentCardDecorator2D) : base(parentLayer, factory, false) { this.Position = parentCardDecorator2D.Position; this.ObjectSprite.Texture = factory.GetTextureById("starEffectTexture"); this.ObjectSprite.Origin = new SFML.System.Vector2f(this.ObjectSprite.TextureRect.Width / 2, this.ObjectSprite.TextureRect.Height / 2); // Active animation SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(4), AnimationType.ONETIME); IAnimation anim = new ZoomAnimation(0.1f, 1, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); sequence.AddAnimation(0, anim); //anim = new ZoomAnimation(1, 0.1f, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); //sequence.AddAnimation(5, anim); anim = new RotationAnimation(0, 360, Time.FromSeconds(6), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0.01f, anim); this.animationsList.Add(sequence); this.IsActive = false; }
void Awake() { //init animation flipInAnimation = new RotationAnimation(); flipOutAnimation = new RotationAnimation(); //if song messenger exists (aka. exits from Record Beat or Playing scenes) if (SongInfoMessenger.Instance != null) { //set curr song currSong = SongInfoMessenger.Instance.currentSong; //set indices currCollectionIndex = currSong.collection; currSongSetIndex = currSong.songNum; currEasyDifficulty = currSong.easyDifficulty; //configure curr board ConfigureCurrSongBoard(); //make era board disappear eraBoardTransform.transform.localRotation = Quaternion.Euler(horizontalFlip); //make curr song board appear currSongBoard.rectTransform.transform.localRotation = Quaternion.Euler(0f, 0f, 0f); } else //if not exist, create new SongInfoMessenger { Instantiate(songInfoMessengerPrefab); } }
public void SetSkin(JwSkinPackage pkg) { pkg.BindAndResize(BackgroundIcon, componentName, "background"); pkg.BindHoverButton(PlayIcon, componentName, "playIcon", "playIconOver"); pkg.BindHoverButton(MuteIcon, componentName, "muteIcon", "muteIconOver"); pkg.BindAndResize(BufferIcon, componentName, "bufferIcon"); var interval = pkg.GetSettingValue(componentName, "bufferinterval") ?? "100"; var rotation = pkg.GetSettingValue(componentName, "bufferrotation") ?? "15"; spinAnimation = new RotationAnimation(BufferIcon, TimeSpan.FromMilliseconds(double.Parse(interval)), double.Parse(rotation)); PlayIcon.Clicked += PlayIconClicked; }
public void HideStarEffect() { this.IsActive = false; SequenceAnimation sequence = new SequenceAnimation(Time.FromSeconds(1), AnimationType.ONETIME); IAnimation anim = new ZoomAnimation(1, 0.1f, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.SQUARE_ACC); sequence.AddAnimation(0, anim); anim = new RotationAnimation(this.Rotation, this.Rotation + 60, Time.FromSeconds(1), AnimationType.ONETIME, InterpolationMethod.LINEAR); sequence.AddAnimation(0.01f, anim); this.PlayAnimation(sequence); }
void OnTriggerEnter(Collider other) { if (objectToAnimate1 != null) { Debug.Log(string.Format("Starting animations on {0}.", objectToAnimate1.name)); RotationAnimation anim = objectToAnimate1.GetComponent <RotationAnimation> (); anim.playing = true; anim.timesToRepeat = timesToAnimate; } if (objectToAnimate2 != null) { Debug.Log(string.Format("Starting animations on {0}.", objectToAnimate2.name)); RotationAnimation anim = objectToAnimate2.GetComponent <RotationAnimation> (); anim.playing = true; anim.timesToRepeat = timesToAnimate; } }
void Awake() { Instance = this; //init fields defaultClips = SongInfoMessenger.Instance.currentSong.defaultBeats; len = defaultClips.Length; savedClips = new AudioClip[len]; for (int i = 0; i < len; i++) { savedClips[i] = null; } //animations mainFlipDownAnimation = new RotationAnimation(); boardFlipUpAnimation = new RotationAnimation(); boardRecInnerAnimation = new ImageColorAnimation( boardMicInner, new Color(boardMicInner.color.r, boardMicInner.color.g, boardMicInner.color.b, 1f), boardMicInner.color, 0f //configure after the clip is recorded ); boardDefaultInnerAnimation = new ImageColorAnimation( boardDefaultInner, new Color(boardDefaultInner.color.r, boardDefaultInner.color.g, boardDefaultInner.color.b, 1f), boardDefaultInner.color, 0f //configure when the board is flipped ); //toggle event ToggleBar.toggledEvent += Toggled; //init mic Microphone.Start(null, false, 1, 44100); //iPhoneSpeaker.ForceToSpeaker(); Microphone.End(null); }
void OnEnable() { instance = target as RotationAnimation; }
public void ContinueStarEffect() { IAnimation anim = new RotationAnimation(this.Rotation, this.Rotation + 360, Time.FromSeconds(6), AnimationType.LOOP, InterpolationMethod.LINEAR); this.PlayAnimation(anim); }