예제 #1
0
        public void CreateEffectBuilders(EffectResourceBuilder resBuilder)
        {
            // Find and Clone Individual Effects
            IndexBuilder     iBldr;
            EffectBuilder    eBldr;
            VisualEffectType eType;
            int i, index, count = this.mIndexBuilders.Count;

            this.mEffectBuilders = new List <EffectBuilder>(count);
            for (i = 0; i < count; i++)
            {
                iBldr = this.mIndexBuilders[i] as IndexBuilder;
                eType = iBldr.EffectType;
                if (eType == (VisualEffectType)0)
                {
                    string header = "Effect: " + this.mEffectName + "; Index: " + i.ToString("X2")
                                    + "; BlockIndex: " + iBldr.ComponentIndex.ToString("X4");
                    System.Diagnostics.Debug.WriteLine(header + "; Unrecognized VisualEffectType (0); Assuming Particle (1)");
                    eType = VisualEffectType.Particle;
                }
                eBldr = new EffectBuilder(eType, iBldr.ComponentIndex);
                index = this.mEffectBuilders.IndexOf(eBldr);
                if (index >= 0)
                {
                    iBldr.SetEffectBuilder(this.mEffectBuilders[index]);
                }
                else
                {
                    eBldr.Effect = resBuilder.GetEffect(eType, iBldr.ComponentIndex);
                    this.mEffectBuilders.Add(eBldr);
                    iBldr.SetEffectBuilder(eBldr);
                }
            }
        }
예제 #2
0
 public void SetEffectBuilder(EffectResourceBuilder source)
 {
     if (this.mEffectBuilder != null)
     {
         this.mEffectBuilder.RemoveIndex(this);
     }
     this.mEffectBuilder        = new EffectBuilder(this.EffectType, this.ComponentIndex);
     this.mEffectBuilder.Effect = source.GetEffect(this.EffectType, this.ComponentIndex);
     this.mEffectBuilder.AddIndex(this);
 }