コード例 #1
0
    private void Update()
    {
        if ((this.timePassed += Time.deltaTime) < 0.05f)
        {
            return;
        }
        this.timePassed -= 0.05f;
        List <MecanimEvent> events = MecanimEventManager.GetEvents(this.animatorController.GetInstanceID(), this.animator);

        for (int i = 0; i < events.Count; i++)
        {
            MecanimEvent mecanimEvent = events[i];
            MecanimEvent.SetCurrentContext(mecanimEvent);
            MecanimEventEmitTypes mecanimEventEmitTypes = this.emitType;
            if (mecanimEventEmitTypes != MecanimEventEmitTypes.Upwards)
            {
                if (mecanimEventEmitTypes != MecanimEventEmitTypes.Broadcast)
                {
                    if (mecanimEvent.paramType != MecanimEventParamTypes.None)
                    {
                        base.SendMessage(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
                    }
                    else
                    {
                        base.SendMessage(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
                    }
                }
                else if (mecanimEvent.paramType != MecanimEventParamTypes.None)
                {
                    base.BroadcastMessage(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
                }
                else
                {
                    base.BroadcastMessage(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
                }
            }
            else if (mecanimEvent.paramType != MecanimEventParamTypes.None)
            {
                base.SendMessageUpwards(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                base.SendMessageUpwards(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
            }
            MecanimEventManager.PoolEvent(mecanimEvent);
        }
        events.Clear();
    }
コード例 #2
0
    private void Update()
    {
        var events =
            MecanimEventManager.GetEvents(loadedData, lastStates, animatorController.GetInstanceID(), animator);

        foreach (var e in events)
        {
            MecanimEvent.SetCurrentContext(e);

            switch (emitType)
            {
            case MecanimEventEmitTypes.Upwards:
                if (e.paramType != MecanimEventParamTypes.None)
                {
                    SendMessageUpwards(e.functionName, e.parameter, SendMessageOptions.DontRequireReceiver);
                }
                else
                {
                    SendMessageUpwards(e.functionName, SendMessageOptions.DontRequireReceiver);
                }
                break;

            case MecanimEventEmitTypes.Broadcast:
                if (e.paramType != MecanimEventParamTypes.None)
                {
                    BroadcastMessage(e.functionName, e.parameter, SendMessageOptions.DontRequireReceiver);
                }
                else
                {
                    BroadcastMessage(e.functionName, SendMessageOptions.DontRequireReceiver);
                }
                break;

            default:
                if (e.paramType != MecanimEventParamTypes.None)
                {
                    SendMessage(e.functionName, e.parameter, SendMessageOptions.DontRequireReceiver);
                }
                else
                {
                    SendMessage(e.functionName, SendMessageOptions.DontRequireReceiver);
                }
                break;
            }
        }
    }
コード例 #3
0
    private void Update()
    {
        List <MecanimEvent> events = MecanimEventManager.GetEvents(this.loadedData, this.lastStates, this.animatorController.GetInstanceID(), this.animator);

        for (int i = 0; i < events.Count; i++)
        {
            MecanimEvent mecanimEvent = events[i];
            MecanimEvent.SetCurrentContext(mecanimEvent);
            MecanimEventEmitTypes mecanimEventEmitTypes = this.emitType;
            if (mecanimEventEmitTypes != MecanimEventEmitTypes.Upwards)
            {
                if (mecanimEventEmitTypes != MecanimEventEmitTypes.Broadcast)
                {
                    if (mecanimEvent.paramType != MecanimEventParamTypes.None)
                    {
                        base.SendMessage(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
                    }
                    else
                    {
                        base.SendMessage(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
                    }
                }
                else if (mecanimEvent.paramType != MecanimEventParamTypes.None)
                {
                    base.BroadcastMessage(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
                }
                else
                {
                    base.BroadcastMessage(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
                }
            }
            else if (mecanimEvent.paramType != MecanimEventParamTypes.None)
            {
                base.SendMessageUpwards(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                base.SendMessageUpwards(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
            }
        }
    }
コード例 #4
0
    // Token: 0x06001598 RID: 5528 RVA: 0x00078D84 File Offset: 0x00076F84
    private void Update()
    {
        ICollection <MecanimEvent> events = MecanimEventManager.GetEvents(this.animatorController.GetInstanceID(), this.animator);

        foreach (MecanimEvent mecanimEvent in events)
        {
            MecanimEvent.SetCurrentContext(mecanimEvent);
            MecanimEventEmitTypes mecanimEventEmitTypes = this.emitType;
            if (mecanimEventEmitTypes != MecanimEventEmitTypes.Upwards)
            {
                if (mecanimEventEmitTypes != MecanimEventEmitTypes.Broadcast)
                {
                    if (mecanimEvent.paramType != MecanimEventParamTypes.None)
                    {
                        base.SendMessage(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
                    }
                    else
                    {
                        base.SendMessage(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
                    }
                }
                else if (mecanimEvent.paramType != MecanimEventParamTypes.None)
                {
                    base.BroadcastMessage(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
                }
                else
                {
                    base.BroadcastMessage(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
                }
            }
            else if (mecanimEvent.paramType != MecanimEventParamTypes.None)
            {
                base.SendMessageUpwards(mecanimEvent.functionName, mecanimEvent.parameter, SendMessageOptions.DontRequireReceiver);
            }
            else
            {
                base.SendMessageUpwards(mecanimEvent.functionName, SendMessageOptions.DontRequireReceiver);
            }
        }
    }
コード例 #5
0
    void Update()
    {
        if (mecanimEventHandler == null || animatorController == null)
        {
            return;
        }

        MecanimEvent[] events = MecanimEventManager.GetEvents(loadedData, lastStates, animatorController.GetInstanceID(), animator);

        foreach (MecanimEvent e in events)
        {
            MecanimEvent.SetCurrentContext(e);
            var m = ReflectionHelper.GetMethodRecursive(mecanimEventHandler, e.functionName);
            if (e.paramType == MecanimEventParamTypes.None)
            {
                m.FastInvoke(mecanimEventHandler);
            }
            else
            {
                m.FastInvoke(mecanimEventHandler, e.parameter);
            }
        }
    }