EventDelegate.Execute C# (CSharp) Method

Execute() static public method

Execute an entire list of delegates.
static public Execute ( List list ) : void
list List
return void
	static public void Execute (List<EventDelegate> list)
	{
		if (list != null)
		{
			for (int i = 0; i < list.Count; )
			{
				EventDelegate del = list[i];

				if (del != null)
				{
					del.Execute();

					if (i >= list.Count) break;
					if (list[i] != del) continue;

					if (del.oneShot)
					{
						list.RemoveAt(i);
						continue;
					}
				}
				++i;
			}
		}
	}

Same methods

EventDelegate::Execute ( ) : bool

Usage Example

Ejemplo n.º 1
0
    private void Update()
    {
        float num  = (!this.ignoreTimeScale) ? Time.deltaTime : RealTime.deltaTime;
        float num2 = (!this.ignoreTimeScale) ? Time.time : RealTime.time;

        if (!this.mStarted)
        {
            this.mStarted   = true;
            this.mStartTime = num2 + this.delay;
        }
        if (num2 < this.mStartTime)
        {
            return;
        }
        this.mFactor += this.amountPerDelta * num;
        if (this.style == UITweener.Style.Loop)
        {
            if (this.mFactor > 1f)
            {
                this.mFactor -= Mathf.Floor(this.mFactor);
            }
        }
        else if (this.style == UITweener.Style.PingPong)
        {
            if (this.mFactor > 1f)
            {
                this.mFactor         = 1f - (this.mFactor - Mathf.Floor(this.mFactor));
                this.mAmountPerDelta = -this.mAmountPerDelta;
            }
            else if (this.mFactor < 0f)
            {
                this.mFactor         = -this.mFactor;
                this.mFactor        -= Mathf.Floor(this.mFactor);
                this.mAmountPerDelta = -this.mAmountPerDelta;
            }
        }
        if (this.style == UITweener.Style.Once && (this.duration == 0f || this.mFactor > 1f || this.mFactor < 0f))
        {
            this.mFactor = Mathf.Clamp01(this.mFactor);
            this.Sample(this.mFactor, true);
            if (UITweener.current == null)
            {
                UITweener uITweener = UITweener.current;
                UITweener.current = this;
                if (this.onFinished != null)
                {
                    this.mTemp      = this.onFinished;
                    this.onFinished = new List <EventDelegate>();
                    EventDelegate.Execute(this.mTemp);
                    for (int i = 0; i < this.mTemp.Count; i++)
                    {
                        EventDelegate eventDelegate = this.mTemp[i];
                        if (eventDelegate != null && !eventDelegate.oneShot)
                        {
                            EventDelegate.Add(this.onFinished, eventDelegate, eventDelegate.oneShot);
                        }
                    }
                    this.mTemp = null;
                }
                if (this.eventReceiver != null && !string.IsNullOrEmpty(this.callWhenFinished))
                {
                    this.eventReceiver.SendMessage(this.callWhenFinished, this, SendMessageOptions.DontRequireReceiver);
                }
                UITweener.current = uITweener;
            }
            if (this.duration == 0f || (this.mFactor == 1f && this.mAmountPerDelta > 0f) || (this.mFactor == 0f && this.mAmountPerDelta < 0f))
            {
                base.enabled = false;
            }
        }
        else
        {
            this.Sample(this.mFactor, false);
        }
    }
All Usage Examples Of EventDelegate::Execute