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); }
private void OnControllerColliderHit(ControllerColliderHit hit) { CCDesc.HitManager hits = this.Hits; if (!object.ReferenceEquals(hits, null)) { hits.Push(hit); } }
private void DoSetup() { if (!this.didSetup && Application.isPlaying) { this.didSetup = true; (this.ccdesc = base.GetComponent <CCDesc>()).AssignedHitManager = this.hitManager = new CCDesc.HitManager(); } }
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; } }
private void OnDestroy() { if (this.didSetup && !object.ReferenceEquals(this.hitManager, null)) { CCDesc.HitManager hitManager = this.hitManager; this.hitManager = null; if (this.ccdesc != null) { this.ccdesc.AssignedHitManager = null; } hitManager.Dispose(); } }
private void DoSetup() { if (!this.didSetup) { if (!Application.isPlaying) { return; } this.didSetup = true; CCDesc component = base.GetComponent <CCDesc>(); CCDesc cCDesc = component; this.ccdesc = component; CCDesc.HitManager hitManager = new CCDesc.HitManager(); CCDesc.HitManager hitManager1 = hitManager; this.hitManager = hitManager; cCDesc.AssignedHitManager = hitManager1; } }
private void OnDestroy() { if (this.didSetup && !object.ReferenceEquals(this.hitManager, null)) { CCDesc.HitManager hitManager = this.hitManager; this.hitManager = null; if (this.ccdesc) { this.ccdesc.AssignedHitManager = null; } hitManager.Dispose(); } }
private void DoSetup() { if (!this.didSetup) { if (!Application.isPlaying) { return; } this.didSetup = true; CCDesc component = base.GetComponent<CCDesc>(); CCDesc cCDesc = component; this.ccdesc = component; CCDesc.HitManager hitManager = new CCDesc.HitManager(); CCDesc.HitManager hitManager1 = hitManager; this.hitManager = hitManager; cCDesc.AssignedHitManager = hitManager1; } }