Esempio n. 1
0
    IEnumerator Attack(string name)
    {
        m_anim.SetTrigger(name);

        int counter = 0;

        while (m_anim.IsInTransition(0))
        {
            Debug.Log("in transition yield" + counter++);
            yield return(null);
        }

        float timer = 0;

        while (timer < .28f)
        {
            timer += Time.deltaTime;
            float animLength = m_anim.GetCurrentAnimatorStateInfo(0).length;
            float p          = timer / animLength;

            yield return(null);
        }

        PlayerAttack.Invoke();
        while (m_anim.GetCurrentAnimatorStateInfo(0).IsName(attackName))
        {
            yield return(null);
        }
    }
Esempio n. 2
0
 private static void OnAnimation(Message msg, bool isEdited)
 {
     AnimationEvent?.Invoke(new MessageEventArgs()
     {
         msg = msg, isEdited = isEdited
     });
 }
Esempio n. 3
0
 private void OnAnimationEvent(CharacterAnimationEvents animationEvent)
 {
     if (AnimationEvent != null)
     {
         AnimationEvent.Invoke(this, new AnimationEventArgs()
         {
             AnimationEvent = animationEvent
         });
     }
 }
Esempio n. 4
0
        public void theout(object source, EventArgs e)
        {
            if (control == null)
            {
                return;
            }

            frameIndex++;

            AnimationEvent?.Invoke(this);
            // control.Invoke(updateDet, this);
        }
 public void MyCustomEvent(int intValue)
 {
     animationEvent.Invoke(intValue);
 }
Esempio n. 6
0
 internal void OnAnimationEvent(DbAnimationEventArgs e)
 {
     AnimationEvent?.Invoke(this, e);
 }
Esempio n. 7
0
 public void PassAnimationEvent()
 {
     AnimationEvent?.Invoke();
 }
 public void BroadcastAudioEvent(string name)
 {
     audioEvent.Invoke(name);
 }
 public void BroadcastAnimationEvent(string name)
 {
     animationEvent.Invoke(name);
 }
 public void OnAnimationEnd()
 {
     onAnimationEnd.Invoke();
 }
 public void OnAnimationEvent(string eventName)
 {
     WeaponAnimationEvent.Invoke(eventName);
 }
Esempio n. 12
0
 private void OnAnimationEvent(AnimationEvent animationEvent)
 {
     InitContext(animationEvent);
     AnimationEvent.Invoke(_eventContext);
 }
Esempio n. 13
0
 public void OnAnimationEvent(AnimationEvent data)
 {
     AnimationEvent?.Invoke(this, data);
 }
Esempio n. 14
0
 void Update(object obj)
 {
     AnimationEvent?.Invoke(this);
 }
Esempio n. 15
0
        private void Check_Events()
        {
            Thread.CurrentThread.Name = "Memory_Thread_Check_Events";
            List <AnimationItem> AnimationList = new List <AnimationItem>();
            bool First_Check = true;

            while (true)
            {
                IntPtr ptr = ptr_data;
                Thread.Sleep(50);

                //check if events have played
                while (true)
                {
                    IntPtr temp_debugging = ptr;
                    IntPtr name_address   = memory.ReadPointer(ptr);
                    if (name_address == IntPtr.Zero)
                    {
                        break;
                    }

                    string name   = memory.ReadString(name_address, 30);
                    int    amount = memory.ReadInt32(ptr + 0x8);

                    bool found = false;
                    foreach (AnimationItem a in AnimationList)
                    {
                        if (a.name == name)
                        {
                            found = true;
                            if (a.amount != amount)
                            {
                                a.amount = amount;//update to new amount
                                if (!First_Check)
                                {
                                    Notification_Message?.Invoke(this, new StringArg(String.Format("Animation playing name: {0}", name)));
                                    Debug_Message?.Invoke(this, new StringArg(String.Format("Animation playing counter: {0}, address: 0x{1:X}, nameAddress: 0x{2:X}", amount, temp_debugging.ToInt64(), name_address.ToInt64())));
                                    AnimationEvent?.Invoke(this, new StringArg(name));
                                }
                            }

                            break;
                        }
                    }
                    if (!found)
                    {
                        AnimationList.Add(new AnimationItem(name, amount));
                        if (!First_Check)
                        {
                            Notification_Message?.Invoke(this, new StringArg(String.Format("Animation playing name: {0}", name)));
                            Debug_Message?.Invoke(this, new StringArg(String.Format("Animation playing counter: {0}, address: 0x{1:X}, nameAddress: 0x{2:X}", amount, temp_debugging.ToInt64(), name_address.ToInt64())));
                            AnimationEvent?.Invoke(this, new StringArg(name));
                        }
                    }


                    ptr += 0x10;
                }

                First_Check = false;
            }
        }
 // AnimationEvent として clip に設定されて Animator から呼ばれる
 public void OnAnimationKickHit(int sw)
 {
     onKickHit.Invoke(sw);
 }
 public void OnAnimationStart()
 {
     onAnimationStart.Invoke();
 }