Ejemplo n.º 1
0
        public TimeSequenceData(TimeSequenceInfo info)
        {
            sequenceInfo = info;

            if (sequenceInfo.ParticleInfo != null)
            {
                sequenceInfo.ParticleInfo.Initialize();
            }

            Style = info.Style;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// calcurates the duration time.
        /// </summary>
        public void UpdateDuration()
        {
            duration = 0.0f;
            infinite = false;

            for (int i = 0; i < timeSequenceDataList.Count; i++)
            {
                TimeSequenceInfo info = timeSequenceDataList[i].SequenceInfo;

                if (info.Duration <= 0.0f)
                {
                    infinite = true;
                }

                if (info.StartTime + info.Duration > duration)
                {
                    duration = info.StartTime + info.Duration;
                }
            }
        }
Ejemplo n.º 3
0
        private TimeSequenceInfo ReadTimeSequenceInfo()
        {
            TimeSequenceInfo timeSequenceInfo = new TimeSequenceInfo();

            timeSequenceInfo.StartTime = input.ReadSingle();
            timeSequenceInfo.Duration  = input.ReadSingle();
            timeSequenceInfo.Style     = (SequenceStyle)input.ReadInt32();

            // read a ParticleInfo structure.
            if (input.ReadBoolean())
            {
                timeSequenceInfo.ParticleInfo = ReadParticleInfo();
            }

            // read a TextureSequence structure.
            if (input.ReadBoolean())
            {
                timeSequenceInfo.TextureSequence = ReadTextureSequence();
            }

            return(timeSequenceInfo);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates using particle information.
        /// </summary>
        /// <param name="info">the particle information</param>
        /// <param name="resourcePath">the particle file</param>
        public void Create(ref ParticleSequenceInfo info, string resourcePath)
        {
            this.sequenceInfo = info;
            this.resourcePath = resourcePath;

            //  Add TimeSequence to child
            timeSequence = new TimeSequence();
            AddChild(timeSequence);

            for (int i = 0; i < info.TimeSequencesInfo.Count; i++)
            {
                TimeSequenceInfo timeSequenceInfo = info.TimeSequencesInfo[i];

                //  Create a TimeSequenceData using TimeSequenceInfo
                TimeSequenceData timeSequenceData =
                    new TimeSequenceData(timeSequenceInfo);

                //  Create a particle using ParticleInfo and TextureSequence
                //  in the TimeSequenceInfo
                Particle particle = new Particle(resourcePath,
                                                 timeSequenceInfo.ParticleInfo,
                                                 timeSequenceInfo.TextureSequence);

                //  Set owner particle to the TimeSequenceData
                timeSequenceData.Owner = particle;

                //  Add the particle to the TimeSequence's child
                timeSequence.AddChild(particle);

                //  Add TimeSequenceData to the TimeSequence
                timeSequence.AddSequence(timeSequenceData);
            }

            Name = info.Name;

            //  Particle off
            Stop();
        }
Ejemplo n.º 5
0
        public TimeSequenceData(TimeSequenceInfo info)
        {
            sequenceInfo = info;

            if (sequenceInfo.ParticleInfo != null)
                sequenceInfo.ParticleInfo.Initialize();

            Style = info.Style;
        }