void Awake () {
tw = gameObject.GetComponent<TweenPosition>();
uiTweener = tw.GetComponent<UITweener>();
originalPosition = transform.localPosition;
TweenPosition.Begin(gameObject,1f,originalPosition);
//Take the x position from another object on the screen
tw.to.x = liveObj.transform.localPosition.x;
}
private void playTw(){
if(transform.localPosition.x == tw.from.x){
uiTweener.PlayForward();
setStateBonus(true);
}else{
uiTweener.PlayReverse();
setStateBonus(false);
}
GetComponent<UISprite>().ResetAndUpdateAnchors();
}