Exemplo n.º 1
0
        private void DrawLine(List <TrackEntry> track, TrackEntry currentTask, double time)
        {
            Console.SetCursorPosition(0, 3);
            var nextEnd = currentTask.End;

            Console.ForegroundColor = ConsoleColor.Green;

            for (var i = time - (_trackScaleX * BoxCenter); i < (Console.WindowWidth - BoxCenter) * _trackScaleX + time - BoxCenter; i += _trackScaleX) // 6 = offset cursor / left side
            {
                if (i >= nextEnd - (6 * _trackScaleX) && i < nextEnd + OrangeWarningTime - (6 * _trackScaleX))
                {
                    Console.ForegroundColor = ConsoleColor.Yellow;
                }
                if (i >= nextEnd + OrangeWarningTime - (6 * _trackScaleX))
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                }

                Console.Write(LineChar);
            }
        }
 //When DIE-animation is completed...
 private void AnimationCompleteListener(TrackEntry trackEntry)
 {
     if (trackEntry.animation.Name == dieAnimationName)
     {
         //Dust Effect
         if (dieVFX != null)
         {
             ParticleSystem vfx = Instantiate(dieVFX, transform);
             Destroy(vfx, vfx.main.duration);
         }
         //Fade away and destroy
         LeanTween.value(1f, 0f, dieVFX.main.duration).setEaseOutCubic().setOnUpdate((float val) => {
             skeletonAnimation.skeleton.a = val;
         }).setOnComplete(() => {
             if (this.gameObject != null)
             {
                 Destroy(gameObject);
             }
         });
     }
 }
Exemplo n.º 3
0
    public IEnumerator EvolutionAnimations()
    {
        int tier = Singleton <HeroTeamRunner> .Instance.GetOrCreateHeroRunner(m_heroIndex).Tier.Value;

        m_graphic.AnimationState.SetAnimation(0, "Idle", loop: true);
        string animName = "Level" + Mathf.Min(tier - 2, 2).ToString();

        m_graphic.AnimationState.SetAnimation(1, animName, loop: true);
        yield return(new WaitForSeconds(1.5f));

        string     transName  = "Transition_Level" + (tier - 2).ToString() + "to" + (tier - 1).ToString();
        TrackEntry trackEntry = m_graphic.AnimationState.SetAnimation(0, transName, loop: false);

        m_graphic.AnimationState.SetEmptyAnimation(1, 0f);
        yield return(new WaitForSpineAnimationComplete(trackEntry));

        m_graphic.AnimationState.SetAnimation(0, "Idle", loop: true);
        string evolvedAnim = "Level" + Mathf.Min(tier - 1, 3).ToString();

        m_graphic.AnimationState.SetAnimation(1, evolvedAnim, loop: true);
    }
Exemplo n.º 4
0
    protected override void OnComplete(TrackEntry trackEntry)
    {
        base.OnComplete(trackEntry);
        if (trackEntry.Animation.Name.Equals(aec.attack1.name))
        {
            PlayAnim(0, aec.idle, true);

            if (timechangeShield <= 0)
            {
                enemyState = EnemyState.idle;
                //    sheld.SetActive(true);
                isShield         = true;
                timechangeShield = maxtimedelayChangePos;
                PlayAnim(1, aec.jumpOut, false);
            }
        }
        else if (trackEntry.Animation.Name.Equals(aec.jumpOut.name))
        {
            PlayAnim(1, aec.lowHPAnim, true);
        }
    }
Exemplo n.º 5
0
    public virtual void HandleEvent(TrackEntry trackEntry, Spine.Event e)
    {
        // if (m_PhotonView != null && !m_PhotonView.isMine) return;

        if (e.Data.Name == Constants.SpineEventName_Attack ||
            e.Data.Name == Constants.SpineEventName_attack)
        {
            this.AtkAnimationEvent();
        }
        if (e.Data.Name == Constants.SpineEventName_Step || e.Data.Name == "Run")
        {
            float pitch = 0.9f + UnityEngine.Random.Range(-0.15f, 0.15f);
            // footstepAudioSource.Play();
            // AudioManager.instance.Play(Get_Step_AudioName(), pitch);
        }
        // if(e.Data.Name == "Run")
        // {
        //     float pitch = 0.9f + UnityEngine.Random.Range(-0.15f, 0.15f);
        //     // footstepAudioSource.Play();
        //     AudioManager.instance.Play("Slime_Step_01",pitch);
        // }
    }
Exemplo n.º 6
0
    private void OnComplete(TrackEntry trackEntry)
    {
        var animName = trackEntry.Animation.Name;

        if (animName == tapAnim)
        {
            switch (GAME_MODE_TYPE)
            {
            case GAME_MODE_TYPE.MODE_1:
                ScreenStart.instance.StartMode_1();
                break;

            case GAME_MODE_TYPE.MODE_2:
                ScreenStart.instance.StartMode_2();
                break;

            case GAME_MODE_TYPE.MODE_3:
                ScreenStart.instance.StartMode_3();
                break;
            }
        }
    }
Exemplo n.º 7
0
 protected override void OnComplete(TrackEntry trackEntry)
 {
     base.OnComplete(trackEntry);
     if (trackEntry.Animation.Name.Equals(aec.attack1.name))
     {
         PlayAnim(0, aec.idle, true);
         if (combo == randomCombo)
         {
             combo          = 0;
             randomCombo    = Random.Range(3, 5);
             isGrenadeStage = false;
             enemyState     = EnemyState.idle;
             PlayAnim(0, aec.run2, false);
         }
         else
         {
             enemyState = EnemyState.idle;
             PlayAnim(0, aec.attack3, false);
         }
     }
     else if (trackEntry.Animation.Name.Equals(aec.run2.name))
     {
         enemyState = EnemyState.attack;
         skeletonAnimation.AnimationState.SetAnimation(2, targetAnim, false);
         timePreviousAttack = 0;
     }
     else if (trackEntry.Animation.Name.Equals(aec.attack3.name))
     {
         enemyState = EnemyState.attack;
     }
     //if (enemyState == EnemyState.die)
     //    return;
     //if (aec.standup == null)
     //    return;
     //if (trackEntry.Animation.Name.Equals(aec.standup.name))
     //{
     //    enemyState = EnemyState.attack;
     //}
 }
        void ApplyMixAlphaToDelta(ref Vector2 currentDelta, TrackEntry next, TrackEntry track)
        {
            // Apply mix alpha to the delta position (based on AnimationState.cs).
            float mix;

            if (next != null)
            {
                if (next.mixDuration == 0)                   // Single frame mix to undo mixingFrom changes.
                {
                    mix = 1;
                }
                else
                {
                    mix = next.mixTime / next.mixDuration;
                    if (mix > 1)
                    {
                        mix = 1;
                    }
                }
                float mixAndAlpha = track.alpha * next.interruptAlpha * (1 - mix);
                currentDelta *= mixAndAlpha;
            }
            else
            {
                if (track.mixDuration == 0)
                {
                    mix = 1;
                }
                else
                {
                    mix = track.alpha * (track.mixTime / track.mixDuration);
                    if (mix > 1)
                    {
                        mix = 1;
                    }
                }
                currentDelta *= mix;
            }
        }
Exemplo n.º 9
0
    public override void state_Event(TrackEntry trackEntry, Spine.Event e)
    {
        base.state_Event(trackEntry, e);
        //
        float angle = GameManager.BackAngleOfTarget(A_Target, shootPoint.position);

        //
        if (e.Data.Name == "e_atk")
        {
            if (bulletGroupCount >= bulletGroupCountMax)
            {
                bulletGroupCount = 0;
                //
                GameObject obj = Common.Generate(DataController.prefabPath_Bullet + nameof(BulletGroup_3), GameManager.instance.transBullet);
                obj.transform.position = new Vector3(shootPoint.position.x, 0, shootPoint.position.z);
                BulletGroup_3 info = obj.GetComponent <BulletGroup_3>();
                info.parent     = shootPoint;
                info.target     = A_Target;
                info.prefab     = Common.PrefabLoad(DataController.prefabPath_Bullet + myIndex); //子弹类型
                info.prefab2    = Common.PrefabLoad(DataController.prefabPath_Bullet + 5);       //子弹类型
                info.startAngle = angle;
                info.cardInfo   = cardInfo;
                info.Init();
            }
            else
            {
                if (A_Target == null || !A_Target.isLive)
                {
                    return;
                }
                bulletGroupCount++;
                //
                GameManager.instance.SetParticle(PreLoadType.ShootParticle, shootPoint.position, true);
                Tag     tag   = isEnemy ? Tag.Enemy : Tag.Player;
                Vector3 moDir = (A_Target.transform.position - shootPoint.position).normalized * 20;
                CardInfo.SetBullet(tag, myIndex, myIndex, cardInfo.Atk, shootPoint.position, angle, moDir);
            }
        }
    }
Exemplo n.º 10
0
        public bool UpdateTrackKey(TrackEntry trackEntry, string tableName)
        {
            long startDateTime = trackEntry.StartTime.Ticks;
            long endDateTime   = trackEntry.EndTime.Ticks;

            try
            {
                var query = $"UPDATE " + tableName +
                            " SET TrackEntryKey = '" + trackEntry.Id.ToString() + "' " +
                            "WHERE Timestamp BETWEEN " + startDateTime + " AND " + endDateTime;


                connection.Execute(query);

                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return(false);
            }
        }
Exemplo n.º 11
0
    private void OnFinish_AnimationState(TrackEntry trackEntry)
    {
        if (p_bIsDebug)
        {
            Debug.Log(Time.realtimeSinceStartup.ToString("F2") + " " + name + " State_End - Animation : " + trackEntry.Animation.Name + " Current Animation : " + p_pAnimation.state.GetCurrent(0).Animation.Name);
        }

        if (trackEntry.Animation.Name != p_pAnimation.state.GetCurrent(0).Animation.Name)
        {
            return;
        }

        p_pAnimation.state.Complete -= OnFinish_AnimationState;
        p_bIsPlaying = false;

        string strAnimationName = trackEntry.Animation.Name;

        Excute_OnFinishAnimation(strAnimationName, false);

        if (_queueAnimationWait.Count == 0)
        {
            if (_OnFinishAnimation_Continudly != null)
            {
                if (p_bIsDebug)
                {
                    Debug.Log(Time.realtimeSinceStartup.ToString("F2") + " " + name + " State_End - Animation : " + trackEntry.Animation.Name + " Current OnFinish Animation : " + _OnFinishAnimation_Continudly.Method.Name + " Current Animation : " + p_pAnimation.state.GetCurrent(0).Animation.Name);
                }

                var OnFinishAnimationBackup = _OnFinishAnimation_Continudly;
                _OnFinishAnimation_Continudly = null;
                OnFinishAnimationBackup();
            }
        }
        else
        {
            DoPlayAnimation(_queueAnimationWait.Dequeue());
        }
    }
Exemplo n.º 12
0
    private void OnFinish_AnimationState(TrackEntry trackEntry)
    {
        if (CheckDebugFilter(EDebugFilter.Debug_Level_Core))
        {
            Debug.Log(name + " State_End - Animation : " + trackEntry.Animation.Name + "// Current Animation : " + p_pAnimation.state.GetCurrent(0).Animation.Name, this);
        }

        if (trackEntry.Animation.Name != p_pAnimation.state.GetCurrent(0).Animation.Name)
        {
            return;
        }

        p_pAnimation.state.Complete -= OnFinish_AnimationState;
        p_bIsPlaying = false;

        string strAnimationName = trackEntry.Animation.Name;

        Excute_OnFinishAnimation(strAnimationName, false);

        if (_queueAnimationWait.Count == 0)
        {
            if (_OnFinishAnimation_Continudly != null)
            {
                if (CheckDebugFilter(EDebugFilter.Debug_Level_Core))
                {
                    Debug.Log(name + " State_End - Animation : " + trackEntry.Animation.Name + "// Current OnFinish Animation : " + _OnFinishAnimation_Continudly.Method.Name + "// Current Animation : " + p_pAnimation.state.GetCurrent(0).Animation.Name, this);
                }

                var OnFinishAnimationBackup = _OnFinishAnimation_Continudly;
                _OnFinishAnimation_Continudly = null;
                OnFinishAnimationBackup();
            }
        }
        else
        {
            DoPlayAnimation(_queueAnimationWait.Dequeue());
        }
    }
Exemplo n.º 13
0
        private void BlockBeginAnimationEvent(TrackEntry trackEntry, Spine.Event evt)
        {
            BrawlerAction action = Brawler.CurrentAction;

            if (Brawler.BrawlerData.BlockVolumeSpawnEvent == evt.Data.Name)
            {
                _blockVolume.EnableVolume(true);
            }
            else if (Brawler.BrawlerData.ParryWindowOpenEvent == evt.Data.Name)
            {
                action.Type = BrawlerAction.ActionType.Parry;
            }
            else if (Brawler.BrawlerData.ParryWindowCloseEvent == evt.Data.Name)
            {
                action.Type = BrawlerAction.ActionType.Block;
            }
            else
            {
                Debug.LogWarning($"Unhandled block begin event: {evt.Data.Name}");
            }

            Brawler.CurrentAction = action;
        }
Exemplo n.º 14
0
        private void HitAnimationEvent(TrackEntry trackEntry, Spine.Event evt)
        {
            BrawlerAction action = Brawler.CurrentAction;

            if (Brawler.BrawlerData.HitImpactEvent == evt.Data.Name)
            {
                // TODO: what do we do with this?
            }
            else if (Brawler.BrawlerData.HitStunEvent == evt.Data.Name)
            {
                action.IsStunned = true;
            }
            else if (Brawler.BrawlerData.HitImmunityEvent == evt.Data.Name)
            {
                action.IsImmune = true;
            }
            else
            {
                Debug.LogWarning($"Unhandled hit end event: {evt.Data.Name}");
            }

            Brawler.CurrentAction = action;
        }
Exemplo n.º 15
0
 protected override void OnComplete(TrackEntry trackEntry)
 {
     base.OnComplete(trackEntry);
     if (trackEntry.Animation.Name.Equals(aec.attack1.name))
     {
         enemyState = EnemyState.idle;
         if (!incam)
         {
             return;
         }
         boxAttack1.gameObject.SetActive(false);
     }
     else if (trackEntry.Animation.Name.Equals(aec.jumpOut.name))
     {
         PlayAnim(0, aec.idle, true);
         takeDamageBox.enabled = true;
         jumpOut = false;
         if (!GameController.instance.autoTarget.Contains(this) && incam)
         {
             GameController.instance.autoTarget.Add(this);
         }
     }
 }
Exemplo n.º 16
0
    protected override void OnEvent(TrackEntry trackEntry, Spine.Event e)
    {
        base.OnEvent(trackEntry, e);

        if (trackEntry.Animation.Name.Equals(aec.attack1.name))
        {
            if (!incam)
            {
                return;
            }
            //bullet = ObjectPoolerManager.Instance.bulletEnemyV1Pooler.GetPooledObject();
            //var bulletScript = bullet.GetComponent<BulletEnemy>();
            //bulletScript.AddProperties(damage1, bulletspeed1);
            //bulletScript.SetDir(attackrank, true);
            //bullet.transform.position = boneBarrelGun.GetWorldPosition(skeletonAnimation.transform);
            //bullet.transform.eulerAngles = new Vector3(0, 0, 150);
            //bullet.SetActive(true);

            bulletEnemy = ObjectPoolManagerHaveScript.Instance.bulletEnemyV1Pooler.GetBulletEnemyPooledObject();
            bulletEnemy.AddProperties(damage1, bulletspeed1);
            if (FlipX)
            {
                bulletEnemy.SetDir(-attackrank, true);
            }
            else
            {
                bulletEnemy.SetDir(attackrank, true);
            }
            bulletEnemy.rid.gravityScale      = 1;
            bulletEnemy.isGrenade             = true;
            bulletEnemy.transform.position    = boneBarrelGun.GetWorldPosition(skeletonAnimation.transform);
            bulletEnemy.transform.eulerAngles = rotationbullet;
            bulletEnemy.gameObject.SetActive(true);

            SoundController.instance.PlaySound(soundGame.soundv1attack);
        }
    }
Exemplo n.º 17
0
 // Token: 0x06008ADA RID: 35546 RVA: 0x00287624 File Offset: 0x00285824
 public void PlayAnimation(string name, bool loop, int trackIndex = 0)
 {
     if (this.m_spine == null)
     {
         return;
     }
     if (string.IsNullOrEmpty(name))
     {
         return;
     }
     if (this.m_replaceAnims != null)
     {
         foreach (ReplaceAnim replaceAnim in this.m_replaceAnims)
         {
             if (name == replaceAnim.DefaultName)
             {
                 name = replaceAnim.ReplaceName;
                 break;
             }
         }
     }
     Spine.Animation animation = this.m_spine.AnimationState.Data.SkeletonData.FindAnimation(name);
     if (animation != null)
     {
         TrackEntry current = this.m_spine.AnimationState.GetCurrent(trackIndex);
         if (loop && this.m_isAnimationLoop && current != null && current.Animation == animation)
         {
             return;
         }
         this.m_spine.AnimationState.SetAnimation(trackIndex, animation, loop);
         this.m_isAnimationLoop = loop;
     }
     else
     {
         global::Debug.LogWarning(this.m_spine.skeletonDataAsset.name + " animation " + name + " not found.");
     }
 }
Exemplo n.º 18
0
 protected override void OnComplete(TrackEntry trackEntry)
 {
     base.OnComplete(trackEntry);
     if (trackEntry.Animation.Name.Equals(aec.attack1.name))
     {
         //   isAttacking = false;
         PlayAnim(0, aec.idle, true);
         if (combo == randomCombo)
         {
             combo          = 0;
             isGrenadeStage = false;
             enemyState     = EnemyState.idle;
         }
     }
     else if (trackEntry.Animation.Name.Equals(aec.attack2.name))
     {
         enemyState = EnemyState.idle;
         if (!incam)
         {
             return;
         }
         boxAttack1.gameObject.SetActive(false);
     }
     if (enemyState == EnemyState.die)
     {
         return;
     }
     if (aec.standup == null)
     {
         return;
     }
     if (trackEntry.Animation.Name.Equals(aec.standup.name))
     {
         isGrenadeStage = false;
         Debug.LogError("wtf");
     }
 }
Exemplo n.º 19
0
                private void PlayAnimation(TrackEntry[] trackEntries, int trackIndex, ChannelAnimationData animation)
                {
                    if (animation._animation != null)
                    {
                        TrackEntry trackEntry = trackEntries[trackIndex];

                        if (trackEntry == null || trackEntry.Animation != animation._animation)
                        {
                            _animationState.ClearTrack(trackIndex);
                            trackEntry = _animationState.SetAnimation(trackIndex, animation._animation, true);
                        }

                        if (trackEntry != null)
                        {
                            trackEntry.TrackTime = animation._animationTime * animation._animationSpeed;
                            trackEntry.Alpha     = animation._animationWeight;
                            trackEntry.TimeScale = animation._animationSpeed;
                        }
                    }
                    else
                    {
                        _animationState.ClearTrack(trackIndex);
                    }
                }
Exemplo n.º 20
0
    protected override void OnEvent(TrackEntry trackEntry, Spine.Event e)
    {
        base.OnEvent(trackEntry, e);
        if (trackEntry.Animation.Name.Equals(aec.attack1.name))
        {
            if (!incam)
            {
                return;
            }

            bulletEnemy = ObjectPoolManagerHaveScript.Instance.bulletEnemyEN0Pooler.GetBulletEnemyPooledObject();
            bulletEnemy.AddProperties(damage1, bulletspeed1);
            if (combo == 0)
            {
                dirBullet = posTemp - (Vector2)boneBarrelGun.GetWorldPosition(skeletonAnimation.transform);
                bulletEnemy.transform.position = boneBarrelGun.GetWorldPosition(skeletonAnimation.transform);
            }
            else if (combo == 1)
            {
                dirBullet = posTemp - (Vector2)boneBarrelGun1.GetWorldPosition(skeletonAnimation.transform);
                bulletEnemy.transform.position = boneBarrelGun1.GetWorldPosition(skeletonAnimation.transform);
            }
            angle    = Mathf.Atan2(dirBullet.y, dirBullet.x) * Mathf.Rad2Deg;
            rotation = Quaternion.AngleAxis(angle, Vector3.forward);
            bulletEnemy.transform.rotation = rotation;

            bulletEnemy.BeginDisplay(Vector2.zero, this);
            listMyBullet.Add(bulletEnemy);

            bulletEnemy.gameObject.SetActive(true);

            combo++;
            DetecPosPlayer();
            SoundController.instance.PlaySound(soundGame.soundEN0Attack);
        }
    }
        protected void HandleClipEnd()
        {
            if (animationStateComponent.IsNullOrDestroyed())
            {
                return;
            }

            var state = animationStateComponent.AnimationState;

            if (endAtClipEnd &&
                timelineStartedTrackEntry != null &&
                timelineStartedTrackEntry == state.GetCurrent(trackIndex))
            {
                if (endMixOutDuration >= 0)
                {
                    state.SetEmptyAnimation(trackIndex, endMixOutDuration);
                }
                else                 // pause if endMixOutDuration < 0
                {
                    timelineStartedTrackEntry.TimeScale = 0;
                }
                timelineStartedTrackEntry = null;
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// 播放动画 3-待机 0-攻击 2-被攻击 4-死亡
        /// endPlayLastAnim 结束后是播回到之前的动画
        /// </summary>
        void Play(string aniName, bool isLoop = false, bool endPlayLastAnim = false)
        {
            //if (animations.Length < index)
            //    return;
            //skeletonGraphic.AnimationState.AddAnimation(0, animations[index], isLoop, 0);
            //if (index != 0 && skeletonGraphic != null)
            //    skeletonGraphic.AnimationState.AddAnimation(0, animations[0], true, 0);
            if (!aniNameList.Contains(aniName))
            {
                return;
            }

            TrackEntry track = skeletonGraphic.AnimationState.SetAnimation(0, aniName, isLoop);

            if (endPlayLastAnim)
            {
                track.Complete += Track_Complete;
            }
            else
            {
                _lastAnimName   = aniName;
                _lastAnimIsLoop = isLoop;
            }
        }
Exemplo n.º 23
0
 private void HandleComplete(TrackEntry trackEntry)
 {
     this.m_WasFired = true;
 }
Exemplo n.º 24
0
 public WaitForSpineAnimationComplete(TrackEntry trackEntry)
 {
     this.SafeSubscribe(trackEntry);
 }
Exemplo n.º 25
0
        protected void TrySetAnimation(Object o, bool multi)
        {
            var skeletonAnimation = o as SkeletonAnimation;

            if (skeletonAnimation == null)
            {
                return;
            }
            if (!skeletonAnimation.valid)
            {
                return;
            }

            if (!isInspectingPrefab)
            {
                if (wasAnimationNameChanged)
                {
                    if (modify_check_count <= 0)
                    {
                        modify_check_count = 3;
                    }

                    if (!Application.isPlaying)
                    {
                        if (skeletonAnimation.state != null)
                        {
                            skeletonAnimation.state.ClearTrack(0);
                        }
                        skeletonAnimation.skeleton.SetToSetupPose();
                    }

                    string lastAnimation = "";
                    if (skeletonAnimation.state != null && skeletonAnimation.state.GetCurrent(0) != null)
                    {
                        lastAnimation = skeletonAnimation.state.GetCurrent(0).Animation.Name;
                    }

                    Spine.Animation animationToUse = skeletonAnimation.skeleton.Data.FindAnimation(animationName.stringValue);

                    if (!Application.isPlaying)
                    {
                        if (animationToUse != null)
                        {
                            animationToUse.Apply(skeletonAnimation.skeleton, 0f, 0f, false, null, 1f, true, false);
                        }
                        skeletonAnimation.Update();
                        skeletonAnimation.LateUpdate();
                        requireRepaint = true;
                    }
                    else
                    {
                        if (animationToUse != null)
                        {
                            skeletonAnimation.state.SetAnimation(0, animationToUse, loop.boolValue);
                        }
                        else
                        {
                            skeletonAnimation.state.ClearTrack(0);
                        }
                    }

                    if (lastAnimation != animationName.stringValue || modify_check_count-- < 0)
                    {
                        wasAnimationNameChanged = false;
                        modify_check_count      = 0;
                    }
                }

                // Reflect animationName serialized property in the inspector even if SetAnimation API was used.
                if (!multi && Application.isPlaying)
                {
                    TrackEntry current = skeletonAnimation.state.GetCurrent(0);
                    if (current != null)
                    {
                        if (skeletonAnimation.AnimationName != animationName.stringValue)
                        {
                            animationName.stringValue = current.Animation.Name;
                        }
                    }
                }
            }
        }
Exemplo n.º 26
0
    public override void CompleteHandleEvent(TrackEntry trackEntry)
    {
        switch (trackEntry.ToString())
        {
        case "attack":
            switch (birdLevel)
            {
            case BirdLevel.Normal:
                StandBy(false);
                break;

            case BirdLevel.Elite:
                switch (birdAttackMode)
                {
                case BirdAttackMode.Normal:
                    StandBy(false);
                    break;

                case BirdAttackMode.Special:
                    specialAttackTimes++;
                    Debug.Log($"特殊攻击数量:{specialAttackTimes}");
                    if (specialAttackTimes == 2)
                    {
                        specialAttackCustom.complete = true;
                    }
                    else
                    {
                        DelayAttack(0.25f);
                    }
                    break;
                }
                break;

            case BirdLevel.Boss:
                switch (birdAttackMode)
                {
                case BirdAttackMode.Normal:
                    StandBy(false);
                    break;

                case BirdAttackMode.Special:
                    specialAttackTimes++;
                    Debug.Log($"特殊攻击数量:{specialAttackTimes}");
                    if (specialAttackTimes == 2)
                    {
                        specialAttackCustom.complete = true;
                    }
                    else
                    {
                        DelayAttack(0.25f);
                    }
                    break;
                }
                break;
            }
            break;

        case "Gethit1":
            WaitAttack();
            break;

        case "Standby":
            WaitAttack();
            break;
        }
    }
Exemplo n.º 27
0
    public void Draw()
    {
        if (App.GV.SpineVersion != "3.6.53" || App.GV.FileHash != skeleton.Data.Hash)
        {
            state            = null;
            skeletonRenderer = null;
            return;
        }
        App.graphicsDevice.Clear(Color.Transparent);

        Player.DrawBG(ref App.spriteBatch);


        state.Update(App.GV.Speed / 1000f);

        if (binary != null)
        {
            if (App.GV.Scale != binary.Scale)
            {
                binary.Scale = App.GV.Scale;
                skeletonData = binary.ReadSkeletonData(Common.GetSkelPath(App.GV.SelectFile));
                skeleton     = new Skeleton(skeletonData);
            }
        }
        else if (json != null)
        {
            if (App.GV.Scale != json.Scale)
            {
                json.Scale   = App.GV.Scale;
                skeletonData = json.ReadSkeletonData(Common.GetJsonPath(App.GV.SelectFile));
                skeleton     = new Skeleton(skeletonData);
            }
        }

        skeleton.X                 = App.GV.PosX;
        skeleton.Y                 = App.GV.PosY;
        skeleton.FlipX             = App.GV.FilpX;
        skeleton.FlipY             = App.GV.FilpY;
        skeleton.RootBone.Rotation = App.GV.Rotation;
        skeleton.UpdateWorldTransform();
        state.TimeScale = App.GV.TimeScale;
        state.Apply(skeleton);
        skeletonRenderer.PremultipliedAlpha = App.GV.Alpha;
        if (skeletonRenderer.Effect is BasicEffect)
        {
            ((BasicEffect)skeletonRenderer.Effect).Projection = Matrix.CreateOrthographicOffCenter(0, App.graphicsDevice.Viewport.Width, App.graphicsDevice.Viewport.Height, 0, 1, 0);
        }
        else
        {
            skeletonRenderer.Effect.Parameters["Projection"].SetValue(Matrix.CreateOrthographicOffCenter(0, App.graphicsDevice.Viewport.Width, App.graphicsDevice.Viewport.Height, 0, 1, 0));
        }
        skeletonRenderer.Begin();
        skeletonRenderer.Draw(skeleton);
        skeletonRenderer.End();

        if (state != null)
        {
            TrackEntry entry = state.GetCurrent(0);
            if (entry != null)
            {
                if (App.GV.IsRecoding && App.GV.GifList != null && !entry.IsComplete)
                {
                    if (App.GV.GifList.Count == 0)
                    {
                        TrackEntry te = state.GetCurrent(0);
                        te.trackTime     = 0;
                        App.GV.TimeScale = 1;
                        App.GV.Lock      = 0;
                    }

                    App.GV.GifList.Add(Common.TakeRecodeScreenshot(App.graphicsDevice));
                }

                if (App.GV.IsRecoding && entry.IsComplete)
                {
                    state.TimeScale   = 0;
                    App.GV.IsRecoding = false;
                    Common.RecodingEnd(entry.AnimationEnd);

                    state.TimeScale  = 1;
                    App.GV.TimeScale = 1;
                }

                if (App.GV.TimeScale == 0)
                {
                    entry.TrackTime = entry.AnimationEnd * App.GV.Lock;
                    entry.TimeScale = 0;
                }
                else
                {
                    App.GV.Lock     = entry.AnimationTime / entry.AnimationEnd;
                    entry.TimeScale = 1;
                }
                App.GV.LoadingProcess = $"{ Math.Round(entry.AnimationTime / entry.AnimationEnd * 100, 2)}%";
            }
        }
    }
Exemplo n.º 28
0
 public WaitForSpineAnimationComplete NowWaitFor(TrackEntry trackEntry)
 {
     this.SafeSubscribe(trackEntry);
     return(this);
 }
 public AddEntryCommand(int trackIndex, TrackEntry trackEntry)
 {
     Id = CommandId.AddValue;
     TrackIndex = trackIndex;
     TrackEntry = trackEntry;
 }
Exemplo n.º 30
0
 public virtual void Complete_Event(TrackEntry trackEntry)
 {
     // m_PlayerStateMgr.state_Event(trackEntry, null, E_spinestate.E_spinestate_complete);
 }
Exemplo n.º 31
0
        /// <inheritdoc />
        /// <summary>
        /// </summary>
        /// <param name="element"></param>
        /// <param name="attributes"></param>
        /// <param name="position"></param>
        /// <param name="stream"></param>
        public VideoTrackInfo(XmlNode element, IDictionary <string, string> attributes, uint position, StreamInfo stream) : base(element, position, stream)
        {
            var pixelWidth    = 0u;
            var pixelHeight   = 0u;
            var displayWidth  = 0u;
            var displayHeight = 0u;

            if (Attributes.ContainsKey("MaxWidth"))
            {
                pixelWidth = Parser.UInt32Attribute(Attributes, "MaxWidth");
            }
            else if (Attributes.ContainsKey("Width"))
            {
                pixelWidth = Parser.UInt32Attribute(Attributes, "Width");
            }
            else if (attributes.ContainsKey("MaxWidth"))
            {
                pixelWidth = Parser.UInt32Attribute(attributes, "MaxWidth");
            }

            if (pixelWidth == 0u)
            {
                throw new Exception();
            }

            if (Attributes.ContainsKey("MaxHeight"))
            {
                pixelHeight = Parser.UInt32Attribute(Attributes, "MaxHeight");
            }
            else if (Attributes.ContainsKey("Height"))
            {
                pixelHeight = Parser.UInt32Attribute(Attributes, "Height");
            }
            else if (attributes.ContainsKey("MaxHeight"))
            {
                pixelHeight = Parser.UInt32Attribute(attributes, "MaxHeight");
            }

            if (pixelHeight == 0u)
            {
                throw new Exception();
            }

            if (attributes.ContainsKey("DisplayWidth"))
            {
                displayWidth = Parser.UInt32Attribute(attributes, "DisplayWidth");
            }

            if (displayWidth == 0u)
            {
                displayWidth = pixelWidth;
            }

            if (attributes.ContainsKey("DisplayHeight"))
            {
                displayHeight = Parser.UInt32Attribute(attributes, "DisplayHeight");
            }

            if (displayHeight == 0u)
            {
                displayHeight = pixelHeight;
            }

            var videoInfoBytes = MkvUtils.GetVideoInfoBytes(pixelWidth, pixelHeight, displayWidth, displayHeight);

            byte[] codecPrivateData = null;

            if (Attributes.ContainsKey("CodecPrivateData"))
            {
                codecPrivateData = Parser.HexStringAttribute(Attributes, "CodecPrivateData");
            }

            if (codecPrivateData == null)
            {
                throw new Exception();
            }

            string fourcc = null;

            if (Attributes.ContainsKey("FourCC"))
            {
                fourcc = Parser.StringAttribute(Attributes, "FourCC");
            }
            else if (attributes.ContainsKey("FourCC"))
            {
                fourcc = Parser.StringAttribute(attributes, "FourCC");
            }

            switch (fourcc)
            {
            case "WVC1":

                TrackEntry = new TrackEntry(
                    MkvTrackType.Video, videoInfoBytes, MkvCodec.VideoMs, GetVfWCodecPrivate(
                        pixelWidth, pixelHeight, fourcc, codecPrivateData));
                break;

            case "H264":

                ushort nalUnitLengthField = 4;

                if (Attributes.ContainsKey("NALUnitLengthField"))
                {
                    nalUnitLengthField = Parser.UInt16Attribute(Attributes, "NALUnitLengthField");
                }

                TrackEntry = new TrackEntry(MkvTrackType.Video, videoInfoBytes, MkvCodec.VideoAvc, GetAvcCodecPrivate(codecPrivateData, nalUnitLengthField));

                break;

            case null:

                throw new Exception();

            default:

                throw new Exception();
            }

            if (Attributes.ContainsKey("Name"))
            {
                TrackEntry.Name = Parser.StringAttribute(attributes, "Name");
            }

            TrackEntry.Language = LanguageId.Hungarian;
            Description         = $"{fourcc} {pixelWidth}x{pixelHeight} ({displayWidth}x{displayHeight}) @ {Bitrate / 1000u} kbps";
        }