protected new void Awake() { this.camera = base.camera; this.adaptiveNearPlane = base.GetComponent <AdaptiveNearPlane>(); int num = 0; if (this._effects != null && (int)this._effects.Length != 0) { for (int i = 0; i < (int)this._effects.Length; i++) { if (!this._effects[i] || !(this._effects[i] is ICameraFX)) { Debug.LogWarning(string.Concat("effect at index ", i, " is missing, null or not a ICameraFX"), this); } else { int num1 = num; num = num1 + 1; this._effects[num1] = this._effects[i]; } } } Array.Resize <MonoBehaviour>(ref this._effects, num); Array.Resize <ICameraFX>(ref this.effects, num); if (num != 0) { for (int j = 0; j < num; j++) { this.effects[j] = (ICameraFX)this._effects[j]; } } else { Debug.LogWarning("There are no effects", this); } this.awoke = true; if (this.viewModel) { ViewModel viewModel = this.viewModel; this.viewModel = null; ItemRepresentation itemRepresentation = this.rep; this.rep = null; IHeldItem heldItem = this.item; this.item = null; this.SetViewModel(viewModel, itemRepresentation, heldItem); } base.Awake(); }
protected void Awake() { this.camera = base.camera; this.adaptiveNearPlane = base.GetComponent <AdaptiveNearPlane>(); int newSize = 0; if ((this._effects != null) && (this._effects.Length != 0)) { for (int i = 0; i < this._effects.Length; i++) { if ((this._effects[i] != null) && (this._effects[i] is ICameraFX)) { this._effects[newSize++] = this._effects[i]; } else { Debug.LogWarning("effect at index " + i + " is missing, null or not a ICameraFX", this); } } } Array.Resize <MonoBehaviour>(ref this._effects, newSize); Array.Resize <ICameraFX>(ref this.effects, newSize); if (newSize == 0) { Debug.LogWarning("There are no effects", this); } else { for (int j = 0; j < newSize; j++) { this.effects[j] = (ICameraFX)this._effects[j]; } } this.awoke = true; if (this.viewModel != null) { ViewModel viewModel = this.viewModel; this.viewModel = null; ItemRepresentation rep = this.rep; this.rep = null; IHeldItem item = this.item; this.item = null; this.SetViewModel(viewModel, rep, item); } base.Awake(); }
protected new void Awake() { this.camera = base.camera; this.adaptiveNearPlane = base.GetComponent<AdaptiveNearPlane>(); int num = 0; if (this._effects != null && (int)this._effects.Length != 0) { for (int i = 0; i < (int)this._effects.Length; i++) { if (!this._effects[i] || !(this._effects[i] is ICameraFX)) { Debug.LogWarning(string.Concat("effect at index ", i, " is missing, null or not a ICameraFX"), this); } else { int num1 = num; num = num1 + 1; this._effects[num1] = this._effects[i]; } } } Array.Resize<MonoBehaviour>(ref this._effects, num); Array.Resize<ICameraFX>(ref this.effects, num); if (num != 0) { for (int j = 0; j < num; j++) { this.effects[j] = (ICameraFX)this._effects[j]; } } else { Debug.LogWarning("There are no effects", this); } this.awoke = true; if (this.viewModel) { ViewModel viewModel = this.viewModel; this.viewModel = null; ItemRepresentation itemRepresentation = this.rep; this.rep = null; IHeldItem heldItem = this.item; this.item = null; this.SetViewModel(viewModel, itemRepresentation, heldItem); } base.Awake(); }