コード例 #1
0
ファイル: TimelineKey.cs プロジェクト: dval/Spriter2Unity
        protected virtual void Parse(XmlElement element, Timeline timeline)
        {
            string curveString = element.GetString("curve_type", "linear");
            switch (curveString)
            {
                case "instant":
                    CurveType = Spriter.CurveType.Instant;
                    break;
                case "linear":
                    CurveType = Spriter.CurveType.Linear;
                    break;
                case "quadratic":
                    CurveType = Spriter.CurveType.Quadratic;
                    break;
                case "cubic":
                    CurveType = Spriter.CurveType.Cubic;
                    break;
                case "quartic":
                    CurveType = Spriter.CurveType.Quartic;
                    break;
                case "quintic":
                    CurveType = Spriter.CurveType.Quintic;
                    break;
                default:
                    CurveType = Spriter.CurveType.INVALID;
                    break;
            }

            Timeline = timeline;

            GetCurveParams(element);
        }
コード例 #2
0
        protected override void Parse(XmlElement element, Timeline timeline)
        {
            base.Parse(element, timeline);

            var boneElem = element["bone"];
            Spatial = new SpatialInfo(boneElem);

            Color tint = Color.white;
            tint.r = boneElem.GetFloat("r", 1.0f);
            tint.g = boneElem.GetFloat("g", 1.0f);
            tint.b = boneElem.GetFloat("b", 1.0f);
            tint.a = boneElem.GetFloat("a", 1.0f);
            Tint = tint;
        }
コード例 #3
0
        protected override void Parse(XmlElement element, Timeline timeline)
        {
            base.Parse(element, timeline);

            var objElement = element[XmlKey];

            File = GetFile(objElement);

            Spatial = new SpatialInfo(objElement);

            Vector2 pivot;
            pivot.x = objElement.GetFloat("pivot_x", 0);
            pivot.y = objElement.GetFloat("pivot_y", 0);

            Color tint = Color.white;
            tint.r = objElement.GetFloat("r", 1.0f);
            tint.g = objElement.GetFloat("g", 1.0f);
            tint.b = objElement.GetFloat("b", 1.0f);
            tint.a = objElement.GetFloat("a", 1.0f);
            Tint = tint;
        }
コード例 #4
0
 public BoneTimelineKey(XmlElement element, Timeline timeline)
     : base(element, timeline)
 {
 }
コード例 #5
0
ファイル: TimelineKey.cs プロジェクト: dval/Spriter2Unity
 public TimelineKey(XmlElement element, Timeline timeline)
     : base(element)
 {
     Parse(element, timeline);
 }
コード例 #6
0
 public SpriteTimelineKey(XmlElement element, Timeline timeline)
     : base(element, timeline)
 {
 }
コード例 #7
0
 public SpatialTimelineKey(XmlElement element, Timeline timeline)
     : base(element, timeline)
 {
 }
コード例 #8
0
 protected virtual void Parse(XmlElement element, Timeline timeline)
 {
     Timeline = timeline;
 }