Esempio n. 1
0
 void ListenAnimtaionEvent(Spine.TrackEntry trackEntry, Spine.Event e)
 {
     if (GetAnimationEvent != null)
     {
         GetAnimationEvent(skeletonAnimation, e.data.Name);
     }
 }
Esempio n. 2
0
    void PlayNextGame(Spine.TrackEntry entry)
    {
        GameSound.gameSound.PlaySFX("score_count");

        graphic.AnimationState.Complete -= PlayNextGame;
        controller.ShowResults(gameScore);
    }
Esempio n. 3
0
 void TestEvent(Spine.TrackEntry trackEntry, Spine.Event e)
 {
     if (e.data.name == "atk01")
     {
         Debug.Log("111");
     }
 }
 private void MyCompleteListener(Spine.TrackEntry trackEntry)
 {
     if (npcclass.TypeP == npcClass.Type.contorl)
     {
     }
     loopEndHoldTheAnimation("jump", trackEntry);
     loopEndHoldTheAnimation("hit_sword", trackEntry);
 }
Esempio n. 5
0
 private void HandleAnimationStateEvent(Spine.TrackEntry entry, Spine.Event e)
 {
     eventData_open = boxSkeletonAnimation_result.Skeleton.Data.FindEvent("open");
     if (e.Data == eventData_open)
     {
         SoundManager.instance.UISoundPlay(2);
     }
 }
Esempio n. 6
0
 void ShowMouthStep(Spine.TrackEntry entry)
 {
     isPlaying   = true;
     isMouthStep = true;
     faucet.AnimationState.Complete -= ShowMouthStep;
     mouthStep.SetActive(true);
     sinkStep.SetActive(false);
 }
Esempio n. 7
0
        public WaitForSpineAnimationComplete(Spine.TrackEntry trackEntry)
        {
                        #if PREUNITY_5_3
            Debug.LogWarning("Unity 5.3 or later is required for Spine Unity custom yield instructions to function correctly.");
                        #endif

            SafeSubscribe(trackEntry);
        }
Esempio n. 8
0
 void HandleEvent(Spine.TrackEntry entry, Spine.Event e)
 {
     if (e.Data.name == "Sprinkle")
     {
         psSprinkle1.Play();
         psSprinkle2.Play();
     }
 }
Esempio n. 9
0
    private void PlayBarActorAnimation()
    {
        Random.seed = (int)(Time.time);
        int nRandomIndex = Random.RandomRange(0, m_arrAnimationNames.Length - 1);

        Spine.TrackEntry entry = m_scoreBarActor.AnimationState.SetAnimation(0, m_arrAnimationNames[nRandomIndex], false);
        m_scoreBarActor.timeScale = entry.Animation.Duration / (m_RhythmBeatInterval * 0.001f);
    }
Esempio n. 10
0
 void HandleAnimationStateEventByName(Spine.TrackEntry trackEntry, Spine.Event e)
 {
     m_WasFired |= (e.Data.Name == m_EventName);                     // Check event name string match.
     if (m_WasFired && m_unsubscribeAfterFiring)
     {
         m_AnimationState.Event -= HandleAnimationStateEventByName;                  // Unsubscribe after correct event fires.
     }
 }
Esempio n. 11
0
 void HandleAnimationStateEvent(Spine.TrackEntry trackEntry, Spine.Event e)
 {
     m_WasFired |= (e.Data == m_TargetEvent);                        // Check event data reference match.
     if (m_WasFired && m_unsubscribeAfterFiring)
     {
         m_AnimationState.Event -= HandleAnimationStateEvent;                        // Usubscribe after correct event fires.
     }
 }
 void loopEndHoldTheAnimation(string name, Spine.TrackEntry trackEntry)
 {
     if (thisAnimation.AnimationName == name)   //使跳躍動畫不會回到<none>
     {
         thisAnimation.state.SetAnimation(0, name, false);
         trackEntry.trackTime    = trackEntry.TrackEnd;
         thisAnimation.timeScale = 0.00f;
     }
 }
 // 어택 종료시 초기화
 void AttackEndCheckEvent(Spine.TrackEntry trackEntry)
 {
     if (trackEntry.animation.name.Equals(ANI_ATTACK))//trackEntry.animation.name == ANI_ATTACK)
     {
         m_roboState = BitControl.Clear(m_roboState, (int)ROBO_STATE.COOLTIME);
         m_skletonAnimation.state.SetAnimation(0, ANI_IDLE, true);
         //m_effectAnimator.gameObject.SetActive(true);
         //m_effectAnimator.Play("Robo_attackEffect");
     }
 }
Esempio n. 14
0
    public float GetCurAniTime()
    {
        Spine.TrackEntry curEntry = m_SkeAnimation_0.state.GetCurrent(0);
        if (curEntry != null)
        {
            // return curEntry.AnimationTime;
            return(curEntry.Animation.Duration);
        }

        return(0f);
    }
Esempio n. 15
0
 void SafeSubscribe(Spine.TrackEntry trackEntry)
 {
     if (trackEntry == null)
     {
         // Break immediately if trackEntry is null.
         m_WasFired = true;
     }
     else
     {
         // Function normally.
         trackEntry.Complete += HandleComplete;
     }
 }
Esempio n. 16
0
 void SafeSubscribe(Spine.TrackEntry trackEntry)
 {
     if (trackEntry == null)
     {
         // Break immediately if trackEntry is null.
         Debug.LogWarning("TrackEntry was null. Coroutine will continue immediately.");
         m_WasFired = true;
     }
     else
     {
         trackEntry.Complete += HandleComplete;
     }
 }
Esempio n. 17
0
    override protected void OnInterruptAnimation(Spine.TrackEntry trackEntry)
    {
        //if (diveState != DiveState.Finish)
        //    return;

        //해당 스킬 종료 된 것
        if (skillSettingDive && trackEntry.animation.name == skillSettingDive.animationFinish)
        {
            if (onFinish != null)
            {
                onFinish(this);
            }
        }
    }
Esempio n. 18
0
    void OnInterruptAnimation(Spine.TrackEntry entry)
    {
        //Debug.Log(entry.animation.name);
        if (entry.animation.name == "Resurrect")
        {
            isFinishSpawned = true;
            skeletonAnimation.state.Interrupt -= OnInterruptAnimation;
        }

        //if(heroData.heroID == "Centaur_01_Hero")
        //{
        //    Debug.Log(entry.animation.name);
        //}
    }
Esempio n. 19
0
    public virtual void OnComplete(Spine.TrackEntry trackEntry)
    {
        var animName = trackEntry.Animation.Name;

        if (animName == "swing")
        {
            canHurt      = false;
            isActiveHand = false;
        }

        if (animName == "throw1")
        {
            isJumpGround = false;
        }
    }
Esempio n. 20
0
 private void Boost_Event(Spine.TrackEntry trackEntry, Spine.Event e)
 {
     if (e.Data.Name == "swing")
     {
         _accelerationTrigger = 1;
         if (StartButtonPressed == 1)
         {
             GetComponent <HealthPointsManager>().BoostHeal();
         }
     }
     else if (e.Data.Name == "aswing")
     {
         _accelerationTrigger = 0;
     }
 }
Esempio n. 21
0
    //很像end效果都一樣
    //complete 當完成這次動畫後

    private void MyCompleteListener(Spine.TrackEntry trackEntry)
    {
        if (npcclass.TypeP == npcClass.Type.contorl)
        {
            if (thisAnimation.AnimationName == "jump_sword")   //使跳躍動畫不會回到<none>
            {
                thisAnimation.state.SetAnimation(0, "jump_sword", false);
                thisAnimation.timeScale = 0.1f; // timescale到0會有問題
                trackEntry.TrackTime    = 0.6f;
                Debug.Log(trackEntry.trackIndex);
            }

            //Debug.Log(trackIndex + " " + state.GetCurrent(trackIndex) + ": end");
        }
    }
Esempio n. 22
0
    public void OnDispose(Spine.TrackEntry trackEntry)
    {
        var animName = trackEntry.Animation.Name;

        if (animName == "swing")
        {
            isActiveHand = false;
            BoxHurt.gameObject.SetActive(false);
            canHurt = false;
        }
        if (animName == "throw1")
        {
            isJumpGround = false;
        }
    }
Esempio n. 23
0
    virtual protected void OnStartAnimation(Spine.TrackEntry trackEntry)
    {
        //if (owner.gameObject.name == "CatFighter_01" && owner.team == BattleUnit.Team.Red)
        //    Debug.Log("Start " + trackEntry);

        //해당 스킬 시작 된 것
        if (trackEntry.animation.name == skillSetting.animationName)
        {
            isInAction = true;

            if (onStart != null)
            {
                onStart(this);
            }
        }
    }
    void OnLeftComplete(Spine.TrackEntry e)
    {
        _skeletonAnimation.transform.localScale = new Vector2(1f, transform.localScale.y);

        trackClear = true;

        Tubarao tubarao = null;

        // Kill shark if there is one
        if (SpawnerInimigo.dic.TryGetValue(icePosition, out tubarao))
        {
            tubarao.isAlive = false;
            SpawnerInimigo.dic.Remove(icePosition);
        }
        PlayerManager.Instance.attacking = false;
    }
    // void OnEnd(Spine.TrackEntry e)
    // {
    //  print("Animation end");
    //  transform.localScale = new Vector2(1f, transform.localScale.y);
    //  trackClear = true;
    // }

    void OnComplete(Spine.TrackEntry e)
    {
        // print("Animation complete");

        trackClear = true;

        Tubarao tubarao = null;

        // Kill shark if there is one
        if (SpawnerInimigo.dic.TryGetValue(icePosition, out tubarao))
        {
            tubarao.isAlive = false;
            SpawnerInimigo.dic.Remove(icePosition);
        }
        PlayerManager.Instance.attacking = false;
    }
Esempio n. 26
0
    public void OnEvent(Spine.TrackEntry trackEntry, Spine.Event _event)
    {
        if (skeletonAnimation.state.GetCurrent(0).Animation.Name != skillSetting.animationName)
        {
            return;
        }

        if (skillEffectDic.ContainsKey(_event.Data.name))
        {
            List <ISkillEffect> skillEventList = skillEffectDic[_event.Data.name];
            for (int i = 0; i < skillEventList.Count; i++)
            {
                skillEventList[i].TriggerEffect();
            }
        }
    }
Esempio n. 27
0
    override public void OnEndAnimation(Spine.TrackEntry trackEntry)
    {
        //if (owner.battleGroup == null)
        //    return;

        //if (trackEntry == null || trackEntry.Animation == null || skillSettingDive == null)
        //    return;

        //if (trackEntry.Animation.Name == skillSettingDive.animationFinish)
        //{
        //    skeletonAnimation.state.SetAnimation(0, skillSettingDive.animationFoward, true);
        //}


        //base.OnEndAnimation(trackEntry);
    }
 //Do the rowing animation and play the sound
 IEnumerator MovementAnimation()
 {
     _skeletonAnimation.AnimationState.AddEmptyAnimation(1, 1f, 0.1f);
     while (isMoving)
     {
         if (PlayerManager.Instance.attacking)
         {
             break;
         }
         Spine.TrackEntry teste = _skeletonAnimation.AnimationState.SetAnimation(1, remar, false);
         teste.timeScale = audioPitch;
         rowingSFX.pitch = audioPitch;
         rowingSFX.Play();
         yield return(new WaitForSeconds(rowingSFX.clip.length - (rowingSFX.clip.length * (audioPitch - 1))));
     }
 }
Esempio n. 29
0
 static int GetCurrent(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         Spine.AnimationState obj = (Spine.AnimationState)ToLua.CheckObject(L, 1, typeof(Spine.AnimationState));
         int arg0           = (int)LuaDLL.luaL_checknumber(L, 2);
         Spine.TrackEntry o = obj.GetCurrent(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 30
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        ssc = animator.GetComponentInChildren <SightSpriteController>();
        GameObject[] lsGO = GameObject.FindGameObjectsWithTag(Tags.player);
        if (lsGO.Length > 0)
        {
            pcc = lsGO[0].GetComponent <PlayerCharacterController>();
        }
        SkeletonAnimation skelAnim = animator.GetComponentInChildren <SkeletonAnimation>();

        Spine.TrackEntry currTrack = skelAnim.AnimationState.GetCurrent(0);
        if (currTrack == null || currTrack.Animation != skelAnim.skeleton.Data.FindAnimation(motionName))
        {
            skelAnim.AnimationState.SetAnimation(0, motionName, true).timeScale = speedAnim;
        }
    }
Esempio n. 31
0
        /// <summary>Adds an animation to be played delay seconds after the current or last queued animation.</summary>
        /// <param name="delay">May be <= 0 to use duration of previous animation minus any mix duration plus the negative delay.</param>
        public TrackEntry AddAnimation(int trackIndex, Animation animation, bool loop, float delay)
        {
            TrackEntry entry = new TrackEntry();
            entry.animation = animation;
            entry.loop = loop;
            entry.time = 0;
            entry.endTime = animation.Duration;

            TrackEntry last = ExpandToIndex(trackIndex);
            if (last != null) {
                while (last.next != null)
                    last = last.next;
                last.next = entry;
            } else
                tracks[trackIndex] = entry;

            if (delay <= 0) {
                if (last != null)
                    delay += last.endTime - data.GetMix(last.animation, animation);
                else
                    delay = 0;
            }
            entry.delay = delay;

            return entry;
        }
		void HandleComplete (TrackEntry trackEntry) {
			m_WasFired = true;
		}
Esempio n. 33
0
		/// <summary>Set the current animation. Any queued animations are cleared.</summary>
		public TrackEntry SetAnimation (int trackIndex, Animation animation, bool loop) {
			if (animation == null) throw new ArgumentException("animation cannot be null.");
			TrackEntry entry = new TrackEntry();
			entry.animation = animation;
			entry.loop = loop;
			entry.time = 0;
			entry.endTime = animation.Duration;
			SetCurrent(trackIndex, entry);
			return entry;
		}
Esempio n. 34
0
		private void SetCurrent (int index, TrackEntry entry) {
			TrackEntry current = ExpandToIndex(index);
			if (current != null) {
				TrackEntry previous = current.previous;
				current.previous = null;

				current.OnEnd(this, index);
				if (End != null) End(this, index);

				entry.mixDuration = data.GetMix(current.animation, entry.animation);
				if (entry.mixDuration > 0) {
					entry.mixTime = 0;
					// If a mix is in progress, mix from the closest animation.
					if (previous != null && current.mixTime / current.mixDuration < 0.5f)
						entry.previous = previous;
					else
						entry.previous = current;
				}
			}

			tracks.Items[index] = entry;

			entry.OnStart(this, index);
			if (Start != null) Start(this, index);
		}
		void HandleEnd (TrackEntry trackEntry) {
			m_WasFired = true;
		}
Esempio n. 36
0
		void HandleEvent (TrackEntry trackEntry, Spine.Event e) {
			Debug.Log(trackEntry.trackIndex + " " + trackEntry.animation.name + ": event " + e + ", " + e.Int);
		}
Esempio n. 37
0
 /// <summary>Set the current animation. Any queued animations are cleared.</summary>
 public TrackEntry SetAnimation(int trackIndex, Animation animation, bool loop)
 {
     TrackEntry entry = new TrackEntry();
     entry.animation = animation;
     entry.loop = loop;
     entry.time = 0;
     entry.endTime = animation.Duration;
     SetCurrent(trackIndex, entry);
     return entry;
 }
		public void End (TrackEntry entry) {
#if !WINDOWS_STOREAPP	
			Console.WriteLine(entry + ": end");
#endif
		}
		public void Complete (TrackEntry entry) {
#if !WINDOWS_STOREAPP	
			Console.WriteLine(entry + ": complete ");
#endif
		}
		public void Event (TrackEntry entry, Event e) {
#if !WINDOWS_STOREAPP	
			Console.WriteLine(entry + ": event " + e);
#endif
		}
Esempio n. 41
0
        private void SetCurrent(int index, TrackEntry entry)
        {
            TrackEntry current = ExpandToIndex(index);
            if (current != null) {
                current.previous = null;

                current.OnEnd(this, index);
                if (End != null) End(this, new StartEndArgs(index));

                entry.mixDuration = data.GetMix(current.animation, entry.animation);
                if (entry.mixDuration > 0) {
                    entry.mixTime = 0;
                    entry.previous = current;
                }
            }

            tracks[index] = entry;

            entry.OnStart(this, index);
            if (Start != null) Start(this, new StartEndArgs(index));
        }
		public void Start (TrackEntry entry) {
#if !WINDOWS_STOREAPP
			Console.WriteLine(entry + ": start");
#endif
		}