コード例 #1
0
        public BooleanKeyFrame GetKeyFrame(float frame)
        {
            BooleanKeyFrame key = null;
            int             i;

            for (i = 0; i < Keys.Count; i++)
            {
                if (Keys[i].Frame == frame)
                {
                    key = Keys[i];
                    break;
                }
                if (Keys[i].Frame > frame)
                {
                    break;
                }
            }

            if (key == null)
            {
                key       = new BooleanKeyFrame();
                key.Frame = frame;
                Keys.Insert(i, key);
            }

            return(key);
        }
コード例 #2
0
 public bool SetBoolean(float Frame, bool Value)
 {
     for (int i = 0; i < Keys.Count; i++)
     {
         BooleanKeyFrame key = Keys[i];
         if (key.Frame == Frame)
         {
             key.Visible = Value;
             return(true);
         }
     }
     return(false);
 }
コード例 #3
0
        public bool GetValue(float frame)
        {
            BooleanKeyFrame k1 = (BooleanKeyFrame)Keys[0], k2 = (BooleanKeyFrame)Keys[0];
            int             i = 0;

            if (frame < LastFrame)
            {
                LastFound = 0;
            }
            for (i = LastFound; i < Keys.Count; i++)
            {
                LastFound = i % (Keys.Count);
                BooleanKeyFrame k = Keys[LastFound];
                if (k.Frame < frame)
                {
                    k1 = k;
                }
                else
                {
                    k2 = k;
                    break;
                }
            }
            LastFound -= 1;
            if (LastFound < 0)
            {
                LastFound = 0;
            }
            if (LastFound >= Keys.Count - 2)
            {
                LastFound = 0;
            }
            LastFrame = frame;

            if (k1.InterType == InterpolationType.STEPBOOL)
            {
                return(k1.Visible);
            }

            return(k1.Visible);
        }