public void ChangeAnimation(AnimationClip cip, string stateName="Default") {
		if(animation.GetState(stateName) != null) {
			animation.Stop(stateName);
			animation.RemoveState(stateName);
		}
		animation.AddState(cip, stateName);
		animation.Play(stateName);
	}
        public override void Deactive()
        {
            MessageManager.GetInstance().UnRegist((int)UFrameBuildinMessage.WanderArrived, OnWanderArrived);
            MessageManager.GetInstance().UnRegist((int)GameMessageDefine.AnimalPlayLevelUpEffect, OnAnimalPlayLevelUpEffect);

            //移动到看不见的地方
            this.position = Const.Invisible_Postion;
            this.pathWander.Stop();
            //this.wander.Stop();
            anim.Stop();

            base.Deactive();
        }
Пример #3
0
 // Update is called once per frame
 private void Update()
 {
     if (((int)Time.time) % 3 == 0)
     {
         anim.Stop();
         anim.Play("atk");
     }
 }
Пример #4
0
    public void StartImpactMotion(int index, float actionTime, BaseAction targetAction)
    {
        float saveTime = _simpleAnimation.GetCurrentTime(index);

        StartCoroutine(DriveImpact(index, saveTime, actionTime, targetAction));

        _simpleAnimation.Stop();
    }
Пример #5
0
 public void PlayAnimation(string name)
 {
     //同じnameのステートを呼び出しても、AnimationClipの先頭のイベントは呼び出されない
     //先頭以降なら呼び出されそう
     //「アニメーションが始まったフレームで行いたい処理」はイベント以外でやった方がよさそう
     simpleAnimation.Stop();
     simpleAnimation.Play(name);
     stateChanged = true;
 }
Пример #6
0
 protected override void OnDone()
 {
     if (destroySelf && mObject != null)
     {
         GameObject.Destroy(mObject);
         mObject    = null;
         mAnimation = null;
     }
     else
     {
         if (mAnimation != null)
         {
             mAnimation.Stop();
         }
     }
 }
	public void StopAnime2() {
		animation2.Stop();
	}
Пример #8
0
 public void DamageText()
 {
     textAnime.Stop();
     textAnime.Play();
 }