コード例 #1
0
        public override void  Create()
        {
            AddTag(GameObjectTag.Update);

            Seed                  = new IntValue("Seed");
            Seed.ChangeEvent      = StarChange;
            StarCount             = new IntValue("Star Count");
            StarCount.ChangeEvent = StarChange;

            MinSize             = new FloatValue("Min Size", 500);
            MinSize.ChangeEvent = StarChange;
            MaxSize             = new FloatValue("Max Size", 2500);
            MaxSize.ChangeEvent = StarChange;

            MinRadius             = new FloatValue("Min Radius", 10000);
            MinRadius.ChangeEvent = StarChange;
            MaxRadius             = new FloatValue("Max Radius", 30000);
            MaxRadius.ChangeEvent = StarChange;

            MinColor             = new ColorValue("Min Color", Vector4.One);
            MinColor.ChangeEvent = StarChange;
            MaxColor             = new ColorValue("Max Color", Vector4.One);
            MaxColor.ChangeEvent = StarChange;

            base.Create();
            StarCount.set(100);
        }
コード例 #2
0
        public override void UpdateEditor(GameTime gameTime)
        {
            if (EventCount.get() < 1)
            {
                EventCount.set(1);
            }

            base.UpdateEditor(gameTime);
        }
コード例 #3
0
        public override bool TriggerEvent(EventType Event, string[] args)
        {
            switch (Event)
            {
            case EventType.Add:
                if (args.Count() > 0)
                {
                    Count.add(Logic.ParseI(args[0]));
                }
                else
                {
                    Count.add(1);
                }
                return(true);

            case EventType.AddFrom:
                if (args.Count() > 1 && Logic.ParseI(args[0]) == Count.get())
                {
                    Count.set(Logic.ParseI(args[1]));
                }
                return(true);

            case EventType.AddFromAlt:
                if (args.Count() > 2)
                {
                    if (Logic.ParseI(args[0]) == Count.get())
                    {
                        Count.set(Logic.ParseI(args[1]));
                    }
                    else
                    {
                        Count.set(Logic.ParseI(args[2]));
                    }
                }
                return(true);
            }
            return(base.TriggerEvent(Event, args));
        }