Exemplo n.º 1
0
        private void ProcessMaterialKeyFrames(IList <MaterialAnimationKeyFrame> frames)
        {
            if (frames == null || frames.Count == 0)
            {
                return;
            }

            processedMaterialFrameGroups = new LightList <ProcessedMaterialKeyFrameGroup>();
            // todo -- ensure we release lists where we need to
            // todo -- dont use a list each processed frame group, use a single list sorted sensibly
            for (int i = 0; i < frames.Count; i++)
            {
                MaterialAnimationKeyFrame f          = frames[i];
                MaterialKeyFrameValue[]   properties = f.properties;

                for (int j = 0; j < f.properties.Length; j++)
                {
                    AddMaterialKeyFrame(f.key, properties[j]);
                }
            }

            for (int i = 0; i < processedMaterialFrameGroups.Count; i++)
            {
                MaterialPropertyId property = processedMaterialFrameGroups[i].materialIdPair;

                LightList <ProcessedMaterialKeyFrame> processedKeyFrames = processedMaterialFrameGroups[i].frames;

                processedKeyFrames.Sort(s_MaterialKeyFrameSorter);

                if (processedKeyFrames[0].time != 0f)
                {
                    processedKeyFrames.Insert(0, new ProcessedMaterialKeyFrame(0f, default));
                }
            }
        }
Exemplo n.º 2
0
        public void ProcessStyleKeyFrames(IList <StyleAnimationKeyFrame> frames)
        {
            if (frames == null || frames.Count == 0)
            {
                return;
            }

            processedStyleFrameGroups = new LightList <ProcessedStyleKeyFrameGroup>();

            for (int i = 0; i < frames.Count; i++)
            {
                StyleAnimationKeyFrame f          = frames[i];
                StyleKeyFrameValue[]   properties = f.properties.Array;
                for (int j = 0; j < f.properties.Count; j++)
                {
                    AddKeyFrame(f.key, properties[j]);
                }
            }

            for (int i = 0; i < processedStyleFrameGroups.Count; i++)
            {
                StylePropertyId property = processedStyleFrameGroups[i].propertyId;
                LightList <ProcessedStyleKeyFrame> processedKeyFrames = processedStyleFrameGroups[i].frames;
                processedKeyFrames.Sort(s_StyleKeyFrameSorter);
                if (processedKeyFrames[0].time != 0f)
                {
                    processedKeyFrames.Insert(0, new ProcessedStyleKeyFrame(0f, target.style.GetComputedStyleProperty(property)));
                }
            }
        }
Exemplo n.º 3
0
    public void Insert()
    {
        LightList <int> ints = new LightList <int>();

        ints.Add(0);
        ints.Add(1);
        ints.Add(3);
        ints.Add(4);
        ints.Insert(2, 2);
        Assert.AreEqual(5, ints.Count);
        for (int i = 0; i < ints.Count; i++)
        {
            Assert.AreEqual(i, ints[i]);
        }
    }