當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。