コード例 #1
0
 void Start()
 {
     stats        = GetComponent <PlayerStats>();
     audioSource  = GetComponent <AudioSource>();
     animator     = GetComponent <Animator>();
     animListener = new AnimationListener(this, animStateName, null, OnAnimationExit);
     isAnimating  = false;
 }
コード例 #2
0
        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();
        }
コード例 #3
0
ファイル: ArcLayout.cs プロジェクト: veresbogdan/MMD
        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;
        }
コード例 #4
0
ファイル: Animation.cs プロジェクト: zx8326123/LGame
 public void SetAnimationListener(AnimationListener l)
 {
     this.Listener = l;
 }
コード例 #5
0
 public void RegisterListener(AnimationListener listener)
 {
     listeners.Add(listener);
 }
コード例 #6
0
 /// <summary>
 ///  Listener for enter/exit animations
 /// </summary>
 /// <param name="listener"></param>
 /// <returns></returns>
 public Builder AnimationListener(AnimationListener listener)
 {
     mAnimationListener = listener;
     return(this);
 }
コード例 #7
0
ファイル: Animation.cs プロジェクト: ordanielcmessias/LGame
 public void SetAnimationListener(AnimationListener l)
 {
     this.Listener = l;
 }
コード例 #8
0
ファイル: ZZSprite.cs プロジェクト: Seraphli/TheInsectersWar
 public void setListener(string animationName, AnimationListener listener)
 {
     setListener(animationDatas.getIndex(animationName), listener);
 }
コード例 #9
0
ファイル: ZZSprite.cs プロジェクト: Seraphli/TheInsectersWar
 //playAnimation后才奏效
 public void setListener(int animationIndex, AnimationListener listener)
 {
     animationListeners[animationIndex] = listener;
 }
コード例 #10
0
ファイル: ZZSprite.cs プロジェクト: Seraphli/TheInsectersWar
 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);
 }