public void Register() { Bounds bound = this.collider.bounds; this.center = bound.center; bound = this.collider.bounds; float single = bound.extents.x; bound = this.collider.bounds; float single1 = Mathf.Max(single, bound.extents.y); bound = this.collider.bounds; this.radius = Mathf.Max(single1, bound.extents.z); Occludee occludee = this; this.occludeeId = OcclusionCulling.RegisterOccludee(this.center, this.radius, this.renderer.enabled, this.minTimeVisible, this.isStatic, base.gameObject.layer, new OcclusionCulling.OnVisibilityChanged(occludee.OnVisibilityChanged)); if (this.occludeeId < 0) { Debug.LogWarning(string.Concat("[OcclusionCulling] Occludee registration failed for ", base.name, ". Too many registered.")); } this.state = OcclusionCulling.GetStateById(this.occludeeId); }
public void AddOccludee(Occludee occludee) { this.occludees.Add(occludee); this.rendererNum += occludee.GetRendererNum(); }