void Start()
 {
     stats        = GetComponent <PlayerStats>();
     audioSource  = GetComponent <AudioSource>();
     animator     = GetComponent <Animator>();
     animListener = new AnimationListener(this, animStateName, null, OnAnimationExit);
     isAnimating  = false;
 }
        private ShowCaseView(Context mActivity, string mTitle, ISpanned mSpannedTitle, string mId, double mFocusCircleRadiusFactor, View mView, Color mBackgroundColor, Color mFocusBorderColor, int mTitleGravity, int mTitleStyle, int mTitleSize, int mTitleSizeUnit, int mCustomViewRes, int mFocusBorderSize, int mRoundRectRadius, OnViewInflateListener mViewInflateListener, Animation mEnterAnimation, Animation mExitAnimation, AnimationListener mAnimationListener, bool mCloseOnTouch, bool mEnableTouchOnFocusedView, bool mFitSystemWindows, FocusShape mFocusShape, DismissListener mDismissListener, long mDelay, int mFocusAnimationMaxValue, int mFocusAnimationStep, int mFocusPositionX, int mFocusPositionY, int mFocusCircleRadius, int mFocusRectangleWidth, int mFocusRectangleHeight, bool mFocusAnimationEnabled, int mAnimationDuration = 400, int mCenterX = 0, int mCenterY = 0, ViewGroup mRoot = null, ISharedPreferences mSharedPreferences = null, Calculator mCalculator = null, float[] mLastTouchDownXY = null) : base(mActivity)
        {
            this.mActivity                 = (mActivity as Activity);
            this.mTitle                    = mTitle;
            this.mSpannedTitle             = mSpannedTitle;
            this.mId                       = mId;
            this.mFocusCircleRadiusFactor  = mFocusCircleRadiusFactor;
            this.mView                     = mView;
            this.mBackgroundColor          = mBackgroundColor;
            this.mFocusBorderColor         = mFocusBorderColor;
            this.mTitleGravity             = mTitleGravity;
            this.mTitleStyle               = mTitleStyle;
            this.mTitleSize                = mTitleSize;
            this.mTitleSizeUnit            = mTitleSizeUnit;
            this.mCustomViewRes            = mCustomViewRes;
            this.mFocusBorderSize          = mFocusBorderSize;
            this.mRoundRectRadius          = mRoundRectRadius;
            this.mViewInflateListener      = mViewInflateListener;
            this.mEnterAnimation           = mEnterAnimation;
            this.mExitAnimation            = mExitAnimation;
            this.mAnimationListener        = mAnimationListener;
            this.mCloseOnTouch             = mCloseOnTouch;
            this.mEnableTouchOnFocusedView = mEnableTouchOnFocusedView;
            this.mFitSystemWindows         = mFitSystemWindows;
            this.mFocusShape               = mFocusShape;
            this.mDismissListener          = mDismissListener;
            this.mDelay                    = mDelay;
            this.mAnimationDuration        = mAnimationDuration;
            this.mFocusAnimationMaxValue   = mFocusAnimationMaxValue;
            this.mFocusAnimationStep       = mFocusAnimationStep;
            this.mCenterX                  = mCenterX;
            this.mCenterY                  = mCenterY;
            this.mRoot                     = mRoot;
            this.mSharedPreferences        = mSharedPreferences;
            this.mCalculator               = mCalculator;
            this.mFocusPositionX           = mFocusPositionX;
            this.mFocusPositionY           = mFocusPositionY;
            this.mFocusCircleRadius        = mFocusCircleRadius;
            this.mFocusRectangleWidth      = mFocusRectangleWidth;
            this.mFocusRectangleHeight     = mFocusRectangleHeight;
            this.mLastTouchDownXY          = mLastTouchDownXY;
            this.mFocusAnimationEnabled    = mFocusAnimationEnabled;

            InitializeParameters();
        }
Exemple #3
0
        private void bindChildAnimation(View child, int index, long duration)
        {
            bool expanded = mExpanded;
            int  centerX  = Width / 2;
            int  centerY  = Height / 2;
            int  radius   = expanded ? 0 : mRadius;

            int   childCount = ChildCount;
            float perDegrees = (mToDegrees - mFromDegrees) / (childCount - 1);
            Rect  frame      = computeChildFrame(centerX, centerY, radius, mFromDegrees + index * perDegrees, mChildSize);

            int toXDelta = frame.Left - child.Left;
            int toYDelta = frame.Top - child.Top;

            IInterpolator interpolator;

            if (mExpanded)
            {
                interpolator = new AccelerateInterpolator();
            }
            else
            {
                interpolator = new OvershootInterpolator(1.5f);
            }
            long startOffset = computeStartOffset(childCount, mExpanded, index, 0.1f, duration, interpolator);

            Animation animation = mExpanded ? createShrinkAnimation(0, toXDelta, 0, toYDelta, startOffset, duration,
                                                                    interpolator) : createExpandAnimation(0, toXDelta, 0, toYDelta, startOffset, duration, interpolator);

            bool isLast            = getTransformedIndex(expanded, childCount, index) == childCount - 1;
            var  animationListener = new AnimationListener(isLast);

            animationListener.OnAnimationEndEvent += () =>
            {
                PostDelayed(new Action(
                                () =>
                {
                    onAllAnimationsEnd();
                }), 0);
            };
            animation.SetAnimationListener(animationListener);
            child.Animation = animation;
        }
Exemple #4
0
 public void SetAnimationListener(AnimationListener l)
 {
     this.Listener = l;
 }
Exemple #5
0
 public void RegisterListener(AnimationListener listener)
 {
     listeners.Add(listener);
 }
 /// <summary>
 ///  Listener for enter/exit animations
 /// </summary>
 /// <param name="listener"></param>
 /// <returns></returns>
 public Builder AnimationListener(AnimationListener listener)
 {
     mAnimationListener = listener;
     return(this);
 }
Exemple #7
0
 public void SetAnimationListener(AnimationListener l)
 {
     this.Listener = l;
 }
Exemple #8
0
 public void setListener(string animationName, AnimationListener listener)
 {
     setListener(animationDatas.getIndex(animationName), listener);
 }
Exemple #9
0
 //playAnimation后才奏效
 public void setListener(int animationIndex, AnimationListener listener)
 {
     animationListeners[animationIndex] = listener;
 }
Exemple #10
0
 public void playAnimation(int animationIndex, Mesh pMesh)
 {
     //print(animationName);
     if (nowAnimationData.index == animationIndex)
         return;
     //nowListener.endTheAnimationCallback();
     //nowAnimationData = animationDatas[animationName] as AnimationData;
     nowAnimationData = animationDatas.getData(animationIndex);
     nowListener = animationListeners[animationIndex] ;
     if (nowListener == null)
         nowListener = new AnimationListener();
     nowListener.beginTheAnimationCallback();
     meshRenderer.material = nowAnimationData.material;
     playTime = 0;
     updateMesh(pMesh);
 }