- if (mPropertyOwner && mConnectedToSceneGraph)
- {
- mPropertyOwner->RemoveObserver(*this);
- }
-
- if( mAnimatorFunction )
- {
- delete mAnimatorFunction;
- }
- }
-
- /**
- * Called when Animator is added to the scene-graph in update-thread.
- */
- virtual void ConnectToSceneGraph()
- {
- mConnectedToSceneGraph = true;
- mPropertyOwner->AddObserver(*this);
- }
-
- /**
- * Called when mPropertyOwner is connected to the scene graph.
- */
- virtual void PropertyOwnerConnected( PropertyOwner& owner )
- {
- mEnabled = true;
- }
-
- /**
- * Called when mPropertyOwner is disconnected from the scene graph.
- */
- virtual void PropertyOwnerDisconnected( BufferIndex bufferIndex, PropertyOwner& owner )
- {
- // If we are active, then bake the value if required
- if ( mActive && mDisconnectAction != Dali::Animation::Discard )
- {
- // Bake to target-value if BakeFinal, otherwise bake current value
- Update( bufferIndex, ( mDisconnectAction == Dali::Animation::Bake ? mCurrentProgress : 1.0f ), true );
- }
-
- mActive = false;
- mEnabled = false;
- }
-
- /**
- * Called shortly before mPropertyOwner is destroyed
- */
- virtual void PropertyOwnerDestroyed( PropertyOwner& owner )
- {
- mPropertyOwner = NULL;
- mPropertyAccessor.Reset();
- mEnabled = false;