Example #1
0
        public void Remove()
        {
            var ppc = new ParticleParameterCollection(new ParticleSystem());
            var pu  = ppc.AddUniform <float>("U");
            var pv  = ppc.AddVarying <float>("V");

            Assert.AreEqual(false, ppc.Remove(null));
            Assert.AreEqual(false, ppc.Remove(""));
            Assert.AreEqual(true, ppc.Remove("U"));
            Assert.AreEqual(false, ppc.Remove("U"));
            Assert.AreEqual(true, ppc.Remove("V"));
            Assert.AreEqual(false, ppc.Remove("V"));
        }
Example #2
0
        public void Changed()
        {
            bool changed = false;

            var ppc = new ParticleParameterCollection(new ParticleSystem());

            ppc.Changed += (s, e) => changed = true;

            ppc.Clear();
            Assert.IsFalse(changed);

            ppc.AddVarying <float>("D");
            Assert.IsTrue(changed);

            changed = false;
            ppc.AddUniform <float>("F");
            Assert.IsTrue(changed);

            changed = false;
            ppc.AddUniform <float>("F");
            Assert.IsFalse(changed);

            changed = false;
            ppc.AddVarying <float>("F");
            Assert.IsTrue(changed);

            changed = false;
            ppc.AddUniform <float>("F");
            Assert.IsFalse(changed);

            changed = false;
            ppc.AddVarying <float>("F");
            Assert.IsFalse(changed);

            changed = false;
            ppc.Remove("D");
            Assert.IsTrue(changed);

            changed = false;
            ppc.Clear();
            Assert.IsTrue(changed);
        }
        public void Changed()
        {
            bool changed = false;

              var ppc = new ParticleParameterCollection(new ParticleSystem());
              ppc.Changed += (s, e) => changed = true;

              ppc.Clear();
              Assert.IsFalse(changed);

              ppc.AddVarying<float>("D");
              Assert.IsTrue(changed);

              changed = false;
              ppc.AddUniform<float>("F");
              Assert.IsTrue(changed);

              changed = false;
              ppc.AddUniform<float>("F");
              Assert.IsFalse(changed);

              changed = false;
              ppc.AddVarying<float>("F");
              Assert.IsTrue(changed);

              changed = false;
              ppc.AddUniform<float>("F");
              Assert.IsFalse(changed);

              changed = false;
              ppc.AddVarying<float>("F");
              Assert.IsFalse(changed);

              changed = false;
              ppc.Remove("D");
              Assert.IsTrue(changed);

              changed = false;
              ppc.Clear();
              Assert.IsTrue(changed);
        }
        public void Remove()
        {
            var ppc = new ParticleParameterCollection(new ParticleSystem());
              var pu = ppc.AddUniform<float>("U");
              var pv = ppc.AddVarying<float>("V");

              Assert.AreEqual(false, ppc.Remove(null));
              Assert.AreEqual(false, ppc.Remove(""));
              Assert.AreEqual(true, ppc.Remove("U"));
              Assert.AreEqual(false, ppc.Remove("U"));
              Assert.AreEqual(true, ppc.Remove("V"));
              Assert.AreEqual(false, ppc.Remove("V"));
        }