public override bool TriggerEvent(EventType Event, string[] args)
        {
            switch (Event)
            {
            case EventType.AddObject:
                GameObject o = ParentLevel.FindObject(args[0]);
                if (o != null && o.GetType().IsSubclassOf(typeof(Basic3DObject)))
                {
                    Basic3DObject b = (Basic3DObject)o;

                    if (ObjectCount == 0)
                    {
                        AddTag(GameObjectTag.Update);
                    }

                    if (arySize == ObjectCount)
                    {
                        if (arySize == 0)
                        {
                            PathObjects  = new GameObject[4];
                            PathSpeed    = new float[4];
                            PathPosition = new float[4];
                        }
                        else
                        {
                            arySize *= 2;
                            GameObject[] NewPathObjects  = new GameObject[arySize];
                            float[]      NewPathSpeed    = new float[arySize];
                            float[]      NewPathPosition = new float[arySize];

                            for (int i = 0; i < ObjectCount; i++)
                            {
                                NewPathObjects[i]  = PathObjects[i];
                                NewPathSpeed[i]    = PathSpeed[i];
                                NewPathPosition[i] = PathPosition[i];
                            }

                            PathObjects  = NewPathObjects;
                            PathPosition = NewPathPosition;
                            NewPathSpeed = PathSpeed;
                        }
                    }

                    PathObjects[ObjectCount]  = b;
                    PathPosition[ObjectCount] = Logic.ParseF(args[1]);
                    float f = Logic.ParseF(args[2]);
                    PathSpeed[ObjectCount] = f != 0 ? f : TravelSpeed.get();
                    ObjectCount++;
                }
                return(true);
            }

            return(base.TriggerEvent(Event, args));
        }
Beispiel #2
0
        public override void SetFromArgs(string[] args)
        {
            if (args[4].Equals(""))
            {
                set(new Vector4(Logic.ParseF(args[1]), Logic.ParseF(args[2]), Logic.ParseF(args[3]), 1));
            }
            else
            {
                set(new Vector4(Logic.ParseF(args[1]), Logic.ParseF(args[2]), Logic.ParseF(args[3]), Logic.ParseF(args[4])));
            }

            base.SetFromArgs(args);
        }
Beispiel #3
0
        public override bool TriggerEvent(EventType Event, string[] args)
        {
            if (MyEffect.get() == null)
            {
                return(false);
            }
            else
            {
                if (SpecularParameter == null)
                {
                    SpecularParameter = MyEffect.findEffectParameter("Specular");
                    OldSpecular       = SpecularParameter.GetValueSingle();
                }
                if (ColorParameter == null)
                {
                    ColorParameter = MyEffect.findEffectParameter("Color");
                    OldColor       = ColorParameter.GetValueVector4();
                }
            }

            switch (Event)
            {
            case EventType.Kill:
                Dead.set(true);
                if (args.Count() > 0)
                {
                    float f = Logic.ParseF(args[0]);
                    if (f != 0)
                    {
                        ChangeSpeed.set(f);
                    }
                }
                return(true);

            case EventType.Revive:
                Dead.set(false);
                if (args.Count() > 0)
                {
                    float f = Logic.ParseF(args[0]);
                    if (f != 0)
                    {
                        ChangeSpeed.set(f);
                    }
                }
                return(true);
            }

            return(base.TriggerEvent(Event, args));
        }
Beispiel #4
0
 public override void SetFromArgs(string[] args)
 {
     set(new Vector2(Logic.ParseF(args[1]), Logic.ParseF(args[2])));
 }
Beispiel #5
0
 public override void SetFromArgs(string[] args)
 {
     set(Logic.ParseF(args[1]));
 }