Beispiel #1
0
 // -------------------------------------------------------------------------
 // Overrides
 // -------------------------------------------------------------------------
 public override Tween Build()
 {
     if (target == null)
     {
         return(this);
     }
     accessor = (ITweenAccessor)registeredAccessors[targetClass];
     if (accessor == null && target is TweenAccessor <object> )
     {
         accessor = (TweenAccessor <object>)target;
     }
     if (accessor != null)
     {
         combinedAttrsCnt = accessor._GetValues(target, type, accessorBuffer);
     }
     else
     {
         throw new InvalidOperationException("No TweenAccessor was found for the target");
     }
     if (combinedAttrsCnt > combinedAttrsLimit)
     {
         ThrowCombinedAttrsLimitReached();
     }
     return(this);
 }
Beispiel #2
0
 protected internal override void Reset()
 {
     base.Reset();
     target           = null;
     targetClass      = null;
     accessor         = null;
     type             = -1;
     equation         = null;
     path             = null;
     isFrom           = isRelative = false;
     combinedAttrsCnt = waypointsCnt = 0;
     if (accessorBuffer.Length != combinedAttrsLimit)
     {
         accessorBuffer = new float[combinedAttrsLimit];
     }
     if (pathBuffer.Length != (2 + waypointsLimit) * combinedAttrsLimit)
     {
         pathBuffer = new float[(2 + waypointsLimit) * combinedAttrsLimit];
     }
 }
Beispiel #3
0
 /// <summary>Registers an accessor with the class of an object.</summary>
 /// <remarks>
 /// Registers an accessor with the class of an object. This accessor will be
 /// used by tweens applied to every objects implementing the registered
 /// class, or inheriting from it.
 /// </remarks>
 /// <param name="someClass">An object class.</param>
 /// <param name="defaultAccessor">
 /// The accessor that will be used to tween any
 /// object of class "someClass".
 /// </param>
 public static void RegisterAccessor(Type someClass, ITweenAccessor defaultAccessor)
 {
     registeredAccessors[someClass] = defaultAccessor;
 }