Esempio n. 1
0
        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));
                }
            }
        }
Esempio n. 3
0
        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();
        }
Esempio n. 6
0
        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");
        }
Esempio n. 7
0
 void Awake()
 {
     if (Instance != null)
     {
         Destroy(Instance);
     }
     Instance = this;
 }
Esempio n. 8
0
 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);
 }
Esempio n. 9
0
 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();
 }
Esempio n. 10
0
 public virtual void Dispose()
 {
     for (var n = FirstChild; n != null; n = n.NextSibling)
     {
         n.Dispose();
     }
     Nodes.Clear();
     Animators.Dispose();
 }
Esempio n. 11
0
    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");
    }
Esempio n. 12
0
 /// <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;
         }
     }
 }
Esempio n. 14
0
 void IState.SetAnimator(UnityEngine.Animator animator)
 {
     Animators.Clear();
     Animators.Add(animator);
 }
Esempio n. 15
0
 void IState.AddAnimator(UE.Animator animator)
 {
     Animators.Add(animator);
 }
Esempio n. 16
0
 /// <summary>
 /// アニメーションが全て完了しているか
 /// </summary>
 /// <returns>アニメーションが全て完了しているかどうか。</returns>
 public bool IsFinished()
 {
     return(Animators.Last().Counter.Value >= Animators.Last().Counter.End);
 }