Esempio n. 1
0
        public bool Push(ref CCDesc.Hit evnt)
        {
            if (this.issuingEvent)
            {
                Debug.LogError("Push during event call back");
                return(false);
            }
            CCDesc.HitFilter onHit = this.OnHit;
            if (onHit != null)
            {
                bool flag = false;
                try
                {
                    try
                    {
                        this.issuingEvent = true;
                        flag = !onHit(this, ref evnt);
                    }
                    catch (Exception exception)
                    {
                        Debug.LogException(exception);
                    }
                }
                finally
                {
                    this.issuingEvent = false;
                }
                if (flag)
                {
                    return(false);
                }
            }
            CCDesc.HitManager hitManager = this;
            int num  = hitManager.filledCount;
            int num1 = num;

            hitManager.filledCount = num + 1;
            int num2 = num1;

            if (this.filledCount > this.bufferSize)
            {
                do
                {
                    CCDesc.HitManager hitManager1 = this;
                    hitManager1.bufferSize = hitManager1.bufferSize + 8;
                }while (this.filledCount > this.bufferSize);
                if (this.filledCount <= 1)
                {
                    this.buffer = new CCDesc.Hit[this.bufferSize];
                }
                else
                {
                    CCDesc.Hit[] hitArray = this.buffer;
                    this.buffer = new CCDesc.Hit[this.bufferSize];
                    Array.Copy(hitArray, this.buffer, this.filledCount - 1);
                }
            }
            this.buffer[num2] = evnt;
            return(true);
        }
Esempio n. 2
0
 public void Clear()
 {
     while (this.filledCount > 0)
     {
         CCDesc.Hit hit = new CCDesc.Hit();
         this.buffer[--this.filledCount] = hit;
     }
 }
Esempio n. 3
0
 public void Clear()
 {
     while (this.filledCount > 0)
     {
         CCDesc.HitManager hitManager = this;
         int num  = hitManager.filledCount - 1;
         int num1 = num;
         hitManager.filledCount = num;
         CCDesc.Hit hit = new CCDesc.Hit();
         this.buffer[num1] = hit;
     }
 }
Esempio n. 4
0
        public bool Push(ref CCDesc.Hit evnt)
        {
            if (this.issuingEvent)
            {
                Debug.LogError("Push during event call back");
                return(false);
            }
            CCDesc.HitFilter onHit = this.OnHit;
            if (onHit != null)
            {
                bool flag = false;
                try
                {
                    this.issuingEvent = true;
                    flag = !onHit(this, ref evnt);
                }
                catch (Exception exception)
                {
                    Debug.LogException(exception);
                }
                finally
                {
                    this.issuingEvent = false;
                }
                if (flag)
                {
                    return(false);
                }
            }
            int index = this.filledCount++;

            if (this.filledCount > this.bufferSize)
            {
                do
                {
                    this.bufferSize += 8;
                }while (this.filledCount > this.bufferSize);
                if (this.filledCount > 1)
                {
                    CCDesc.Hit[] buffer = this.buffer;
                    this.buffer = new CCDesc.Hit[this.bufferSize];
                    Array.Copy(buffer, this.buffer, (int)(this.filledCount - 1));
                }
                else
                {
                    this.buffer = new CCDesc.Hit[this.bufferSize];
                }
            }
            this.buffer[index] = evnt;
            return(true);
        }
Esempio n. 5
0
 public bool Push(ControllerColliderHit cchit)
 {
     if (this.issuingEvent)
     {
         Debug.LogError("Push during event call back");
         return(false);
     }
     if (!object.ReferenceEquals(cchit, null))
     {
         CCDesc.Hit evnt = new CCDesc.Hit(cchit);
         return(this.Push(ref evnt));
     }
     return(false);
 }
Esempio n. 6
0
 public CCDesc.Hit[] ToArray()
 {
     CCDesc.Hit[] array = new CCDesc.Hit[this.filledCount];
     this.CopyTo(array, 0);
     return(array);
 }