public Player(MonoGameLibrary.Game game, GameScreen screen, int x, int y, int width, int height) : base(game, screen, Assets.GameObject.Player, x, y, width, height) { IsRigitBody = true; a = new TextureAnimator(game, this, Assets.GameObject.Dust, 300, 0.1, -150, 120, 300, 100); Animators.Add(a); }
protected override void Init(MyObjectBuilder_DefinitionBase def) { base.Init(def); var ob = (MyObjectBuilder_RailSwitchExternalComponentDefinition)def; _layers.Clear(); if (ob.Layers != null) { foreach (var lay in ob.Layers) { _layers.Add(lay); } } MaxAttachmentDistance = ob.MaxAttachmentDistance ?? 1f; MaxAttachmentDistanceSq = MaxAttachmentDistance * MaxAttachmentDistance; ControllerLocation = ob.ControllerLocation ?? Vector3.Zero; AllowDynamic = ob.AllowDynamic ?? false; Animators.Clear(); if (ob.Animators != null) { foreach (var k in ob.Animators) { Animators.Add(new ImmutableAnimator(k)); } } }
protected override void LoadSpriterSprite() { base.LoadSpriterSprite(); BabyLogAnimator = Animators.First(a => a.Entity != null && a.Entity.Name == "BabyLog"); HollyAnimator = Animators.First(a => a.Entity != null && a.Entity.Name == "Holly"); }
/// <summary> Show tooltip at position with text </summary> public void Show(Point pos, string text) { if (Visible == false) { var size = GLOFC.Utils.BitMapHelpers.MeasureStringInBitmap(text, Font, StringFormat); Location = new Point(pos.X + AutoPlacementOffset.X, pos.Y + AutoPlacementOffset.Y); ClientSize = new Size((int)size.Width + 1, (int)size.Height + 1); TopMost = true; tiptext = text; Visible = true; Invalidate(); // must invalidate as paint uses tiptext. if (Parent is GLControlDisplay) { if (FadeInTime > 0) // if we are attached to control display, and we are fading in, do it { Opacity = 0; Animators.Add(new AnimateOpacity(0, FadeInTime, true, ShownOpacity, 0.0f, true)); // note delta time } else { Opacity = ShownOpacity; } } } }
public testObject(MonoGameLibrary.Game game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.enemy, x, y, width, height) { TextureAnimator a = new TextureAnimator(game, this, Assets.smoke, 360, 0, 0.016); Animators.Add(a); a.Start(); }
protected override void LoadSpriterSprite() { base.LoadSpriterSprite(); SnowballAnimator = Animators.First(a => a.Entity != null && a.Entity.Name == "Snowball"); BigArmsAnimator = Animators.First(a => a.Entity != null && a.Entity.Name == "BigArms"); HatAnimator = Animators.First(a => a.Entity != null && a.Entity.Name == "Hat"); }
void Awake() { if (Instance != null) { Destroy(Instance); } Instance = this; }
public Button(MonoGameLibrary.Game game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.getColorTexture(game, Color.Blue), x, y, width, height) { OnHover += onHover; OnLeave += onLeave; OnDown += onClick; a = new MoveAnimator(game, this, 1, 1, new Point(0, 0), new Point(100, 100), new Point(1000, 400), new Point(1000, 500)); Animators.Add(a); }
public Player(Game1 game, Screen screen, int x, int y, int width, int height) : base(game, screen, Assets.image, x, y, width, height) { parent = (TestScreen)screen; a = new FlashAnimator(game, this, 0.1, 0, 0.1, 0); Animators.Add(a); a.Enable = false; //a.Start(); }
public virtual void Dispose() { for (var n = FirstChild; n != null; n = n.NextSibling) { n.Dispose(); } Nodes.Clear(); Animators.Dispose(); }
IEnumerator OpenMenuDoor() { yield return(new WaitForSeconds(2)); StartCoroutine(Animators.TriggerAnim("Door", "Open")); yield return(TriggerAnim("Use Counter")); Human.Dialog.TriggerDialog(HumanEmotion.Question); yield return(DoPet()); yield return(Pause.Access.FadeColor(Color.clear, Color.black)); SceneManager.LoadScene("MainGame"); }
/// <summary> /// アニメーターを追加する。ループするアニメーターは使えません。 /// </summary> /// <param name="animator">アニメーター。</param> /// <returns>シーケンサー。メソッドチェーンできます。</returns> public Sequencer AddAnimator(Animator animator) { if (animator != null) { if (!animator.IsLoop) { Animators.Add(animator); } else { throw new NotSupportedException("Animator can not be loop."); } } return(this); }
/// <summary> Hide tooltip. Can be reshown.</summary> public void Hide() { if (Visible) { if (Parent is GLControlDisplay && FadeOutTime > 0) { var animate = new AnimateOpacity(0, FadeOutTime, true, 0.0f, Opacity, true); animate.FinishAction = (an, ctrl, time) => { ctrl.Visible = false; // animators are removed at this point, find out what the positional mouse args would be and call again to give the next control the chance var me = FindDisplay().MouseEventArgsFromPoint(FindDisplay().MouseWindowPosition); MouseMoved(me); }; Animators.Add(animate); } else { Visible = false; } } }
void IState.SetAnimator(UnityEngine.Animator animator) { Animators.Clear(); Animators.Add(animator); }
void IState.AddAnimator(UE.Animator animator) { Animators.Add(animator); }
/// <summary> /// アニメーションが全て完了しているか /// </summary> /// <returns>アニメーションが全て完了しているかどうか。</returns> public bool IsFinished() { return(Animators.Last().Counter.Value >= Animators.Last().Counter.End); }