当前位置: 首页>>代码示例>>C#>>正文


C# Animation类代码示例

本文整理汇总了C#中Animation的典型用法代码示例。如果您正苦于以下问题:C# Animation类的具体用法?C# Animation怎么用?C# Animation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Animation类属于命名空间,在下文中一共展示了Animation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnButton3Clicked

        void OnButton3Clicked(object sender, EventArgs args)
        {
            Button button = (Button)sender;

            // Create parent animation object.
            Animation parentAnimation = new Animation();

            // Create "up" animation and add to parent.
            Animation upAnimation = new Animation(
                v => button.Scale = v,
                1, 5, Easing.SpringIn,
                () => Debug.WriteLine("up finished"));

            parentAnimation.Add(0, 0.5, upAnimation);

            // Create "down" animation and add to parent.
            Animation downAnimation = new Animation(
                v => button.Scale = v,
                5, 1, Easing.SpringOut,
                () => Debug.WriteLine("down finished"));

            parentAnimation.Insert(0.5, 1, downAnimation);

            // Commit parent animation
            parentAnimation.Commit(
                this, "Animation3", 16, 5000, null,
                (v, c) => Debug.WriteLine("parent finished: {0} {1}", v, c));
        }
开发者ID:jenart,项目名称:xamarin-forms-book-preview-2,代码行数:28,代码来源:ConcurrentAnimationsPage.xaml.cs

示例2: Start

    //public GameObject _player;
    //public float _distance;
    // Use this for initialization
    void Start()
    {
        _animation = GetComponent<Animation> ();
        string _animationToPlay = _animationClip.name.ToString();

        //int animCount = _animation.GetClipCount(); // clip?! Unity people, why not state??
        //Debug.Log("Animations found: " + animCount );

        //_player = GameObject.FindGameObjectWithTag("Player");

        _animation[_animationToPlay].wrapMode = WrapMode.Loop;

        _animation.PlayQueued(_animationToPlay, QueueMode.CompleteOthers);

        //		foreach(AnimationState s in _animation) {
        //
        //			string theName = s.name.ToString();
        //			//_animation[theName].wrapMode = WrapMode.Once;
        //			_animation.PlayQueued(theName, QueueMode.CompleteOthers);
        //
        //
        //
        //		}
        //
    }
开发者ID:BGCX261,项目名称:zombie-ferox-svn-to-git,代码行数:28,代码来源:NPCanimate.cs

示例3: Start

	/// <summary>
	/// Find all idle animations.
	/// </summary>

	void Start ()
	{
		mAnim = GetComponentInChildren<Animation>();
		
		if (mAnim == null)
		{
			Debug.LogWarning(NGUITools.GetHierarchy(gameObject) + " has no Animation component");
			Destroy(this);
		}
		else
		{
			foreach (AnimationState state in mAnim)
			{
				if (state.clip.name == "idle")
				{
					state.layer = 0;
					mIdle = state.clip;
					mAnim.Play(mIdle.name);
				}
				else if (state.clip.name.StartsWith("idle"))
				{
					state.layer = 1;
					mBreaks.Add(state.clip);
				}
			}
		
			// No idle breaks found -- this script is unnecessary
			if (mBreaks.Count == 0) Destroy(this);
		}
	}
开发者ID:ziyihu,项目名称:TheWolfKillerU3D,代码行数:34,代码来源:PlayIdleAnimations.cs

示例4: coroutineAnimation

    public void coroutineAnimation(Animation a, CompleteDelegate completeDeletgate)
    {
        object[] parameters = new object[2]{a, completeDeletgate};

        StatusManager.enableNextOrder = false;
        StartCoroutine("animationWait",parameters);
    }
开发者ID:tomohitoei,项目名称:cureplusProto,代码行数:7,代码来源:SceneInit.cs

示例5: Start

 // Use this for initialization
 void Start()
 {
     anim = gameObject.GetComponent<Animation> ();
     sc = gameObject.GetComponent<SphereCollider> ();
     bc = gameObject.GetComponent<BoxCollider> ();
     initSound ();
 }
开发者ID:hanric,项目名称:runnerVJ,代码行数:8,代码来源:SpiderWorm.cs

示例6: setAnimationTypeAndValue

    /// <summary>
    /// Will set the Animation with the supplied parameter
    /// </summary>
    /// <param name="animation">The Animation to set</param>
    /// <param name="animator">The animator to get the Animations</param>
    /// <param name="parameter">The value for the Animation</param>
    public static void setAnimationTypeAndValue(Animation animation, Animator animator, object value)
    {
        if(value == null) {
            return;
        }

        //Grab what Type of parameter
        AnimatorControllerParameter param = getAnimatorControllerParameter(animation, animator);

        //If param doesn't exist, just get out
        if(param == null) {
            return;
        }

        switch(param.type) {
            case AnimatorControllerParameterType.Bool:
                animator.SetBool(animation.ToString(), (bool)value);
                break;
            case AnimatorControllerParameterType.Float:
                animator.SetFloat(animation.ToString(), (float)value);
                break;
            case AnimatorControllerParameterType.Int:
                animator.SetInteger(animation.ToString(), (int)value);
                break;
            case AnimatorControllerParameterType.Trigger:
                animator.SetTrigger(animation.ToString());
                break;
            default:
                break;
        }
    }
开发者ID:JeffreyGaither,项目名称:Games,代码行数:37,代码来源:AnimationMethods.cs

示例7: Start

    // Use this for initialization
    void Start()
    {
        anim = this.GetComponent<Animation> ();

        //		this.transform.position = Vector3.zero; // make sure the paddle is centered to the base
        //		this.transform.position += new Vector3 (0, startingYOffset, 0);// this will adjust the position to to below the base when the
    }
开发者ID:tensus2000,项目名称:Magnaball_1,代码行数:8,代码来源:Paddle.cs

示例8: Button1_Click

 protected void Button1_Click(object sender, EventArgs e)
 {
     Animation animation = new Animation();
     animation.Type = DropDownList1.SelectedValue;
     try
     {
         animation.Cascade = double.Parse(TextBox1.Text);
     }
     catch (Exception)
     {
         TextBox1.Text = "1";
         animation.Cascade = 1;
     }
     try
     {
         animation.Delay = double.Parse(TextBox2.Text);
     }
     catch (Exception)
     {
         TextBox2.Text = "0.5";
         animation.Delay = 0.5;
     }
     line1.OnShowAnimation = animation;
     OpenFlashChartControl1.Chart = chart;
 }
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:25,代码来源:LineAnimtion.aspx.cs

示例9: Start

    void Start()
    {
        animation = GetComponent<Animation>();
		_source = GetComponent<AudioSource>();

		_madeNoise = false;
    }
开发者ID:alecc08,项目名称:coldline-mtl,代码行数:7,代码来源:PlayerMovement.cs

示例10: Start

	void Start () {
	
		anim = GetComponent<Animation> ();
		death = false;

		enemies = 12;
	}
开发者ID:alecc08,项目名称:coldline-mtl,代码行数:7,代码来源:TonyBrendan.cs

示例11: Start

	void Start () 
    {
        player = GameObject.Find("Player");
        playerState = player.GetComponent<PlayerState>();
        ani = GetComponent<Animation>();
        ani.Play("Idle");
	}
开发者ID:YangJinwoo,项目名称:FPS,代码行数:7,代码来源:Spider.cs

示例12: Start

 public void Start () {
     anim = GetComponent<Animation>();
     animState = anim[anim.clip.name];
     // reset effects
     percent = 0;
     Sample();
 }
开发者ID:gaozhyu,项目名称:unity-ugui,代码行数:7,代码来源:ToggleSlider.cs

示例13: Start

 // Use this for initialization
 void Start()
 {
     // set animation
     this.animation = GetComponent<Animation> ();
     // set fire ligth
     this.fireLigth = this.effects.GetComponent<Light> ();
 }
开发者ID:leds-guarapari,项目名称:terravermelha,代码行数:8,代码来源:AnimationFPSControllerScript.cs

示例14: Start

 // Use this for initialization
 void Start()
 {
     m_Animation = GetComponent<Animation>();
     m_CurrentKeyState = Idle;
     m_StartPos = transform.position;
     m_TargetPos = m_StartPos;
 }
开发者ID:Gh0stBlade,项目名称:TR2-Level-Viewer,代码行数:8,代码来源:TRexStatePlayer.cs

示例15: Setup

 // If target or rigidbody are not set, try using fallbacks
 void Setup()
 {
     if (target == null)
     {
         target = GetComponent<Animation> ();
     }
 }
开发者ID:jiangkuo888,项目名称:ORP_beta,代码行数:8,代码来源:AnimationController.cs


注:本文中的Animation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。