Hello, What I am trying to achieve is the following:
- Add Sprite
- Animate Scale in
- wait for user interaction
- Animate Scale out
void AddSequencePoint(Vector3 position)
{
UISprite sequencePoint = NGUITools.AddSprite(container.gameObject, atlas, "point");
sequencePoint.cachedTransform.localPosition = position;
points.Add (sequencePoint);
sequencePoint.cachedTransform.localScale = new Vector3(0f, 0f, 0f);
TweenScale scale = TweenScale.Begin(sequencePoint.gameObject, 1f, new Vector3( 1f, 1f, 1f) );
}
public void AnimateSequencePointOut(int index)
{
GameObject go = points[index].gameObject;
TweenScale scale = TweenScale.Begin(go, 0.3f, new Vector3( 0f, 0f, 0f) );
scale.animationCurve = new AnimationCurve(new Keyframe(0f, 0f, 0f, 1f), new Keyframe(0.3f, -0.1f, 0.2f, 0.7f), new Keyframe(1f, 1f, 1f, 0f));
}
Renders the points on the screen at a size of 0,0 and never animates it up. If i view the object within the inspector, all of the values are tweening, but nothing changes on screen?
Thanks in advance