private bool SamePrefab(GameObject a, GameObject b) { LOD_Base component = a.GetComponent<LOD_Base>(); LOD_Base component2 = b.GetComponent<LOD_Base>(); LODGroup component3 = a.GetComponent<LODGroup>(); LODGroup component4 = b.GetComponent<LODGroup>(); if (component != null && component2 != null) { return component.High == component2.High && component.Mid == component2.Mid && component.Low == component2.Low && component.billboard == component2.billboard; } if (component3 != null && component4 != null) { return this.CompareLODs(component3, component4); } MeshFilter[] componentsInChildren = a.GetComponentsInChildren<MeshFilter>(); MeshFilter[] componentsInChildren2 = b.GetComponentsInChildren<MeshFilter>(); if (componentsInChildren.Length != componentsInChildren2.Length) { return false; } for (int i = 0; i < componentsInChildren.Length; i++) { if (componentsInChildren[i].sharedMesh != componentsInChildren2[i].sharedMesh) { return false; } } return true; }
public void OnCrash() { int stepCount = this.GetStepCount(); LOD_Base[] array = UnityEngine.Object.FindObjectsOfType <LOD_Base>(); List <LOD_Base> list = new List <LOD_Base>(); Vector3 position = base.transform.position; float num = this.Radius + this.Length; num *= num; float num2 = this.Radius * this.Radius; LOD_Base[] array2 = array; for (int i = 0; i < array2.Length; i++) { LOD_Base lOD_Base = array2[i]; if ((lOD_Base.transform.position - position).sqrMagnitude < num) { list.Add(lOD_Base); } } for (int j = 0; j < stepCount; j++) { float progress = (float)j / (float)stepCount; Vector3 position2 = this.GetPosition(progress); foreach (LOD_Base current in list) { if ((current.transform.position - position2).sqrMagnitude < num2 && (!this.PreferBurning || !current.Burn())) { UnityEngine.Object.Destroy(current); } } NeoGrassCutter.Cut(position2, this.Radius, false); } }
public void SetLodBase(LOD_Base lb) { this.LodTree = (LOD_Trees)lb; this.LodTree.CurrentView = this; if (this.SpawnedCutTree) { this.LodTree.SendMessage("LodChanged", 0, SendMessageOptions.DontRequireReceiver); } }
private void SetLodBase(LOD_Base lodbase) { CustomActiveValueGreeble component = lodbase.GetComponent <CustomActiveValueGreeble>(); if (component.Data != null && component.Index < component.Data._instancesState.Length) { base.Data = component.Data; base.Index = component.Index; this.InitFromData(); } }
public void Start() { int stepCount = this.GetStepCount(); LOD_Base[] array = UnityEngine.Object.FindObjectsOfType <LOD_Base>(); List <LOD_Base> list = new List <LOD_Base>(); Vector3 position = base.transform.position; float num = this.Radius + this.Length; num *= num; float num2 = this.Radius * this.Radius; LOD_Base[] array2 = array; for (int i = 0; i < array2.Length; i++) { LOD_Base lOD_Base = array2[i]; if ((lOD_Base.transform.position - position).sqrMagnitude < num) { list.Add(lOD_Base); } } for (int j = 0; j < stepCount; j++) { float progress = (float)j / (float)stepCount; Vector3 position2 = this.GetPosition(progress); foreach (LOD_Base current in list) { if ((current.transform.position - position2).sqrMagnitude < num2) { CoopTreeId coopTreeId = null; if (BoltNetwork.isServer) { coopTreeId = current.GetComponent <CoopTreeId>(); } UnityEngine.Object.Destroy(current); if (coopTreeId) { coopTreeId.Goto_Removed(); } } } if (this.ShouldCutGrass) { NeoGrassCutter.Cut(position2, this.Radius, false); } } }
private void SetLodBase(LOD_Base lodbase) { CustomActiveValueGreeble component = lodbase.GetComponent <CustomActiveValueGreeble>(); if (component.Data != null && component.Index < component.Data._instancesState.Length) { base.Data = component.Data; base.Index = component.Index; bool flag = base.Data._instancesState[base.Index] < 252; for (int i = 0; i < this._targets.Length; i++) { bool flag2 = !flag || ((int)base.Data._instancesState[base.Index] & 1 << i) == 0; if (this._targets[i] && flag2 != this._targets[i].activeSelf) { this._targets[i].SetActive(flag2); } } } }
public void SetLodBase(LOD_Base lb) { this.LodBase = lb; }
public void SetLodBase(LOD_Base lb) { this.LodTree = (LOD_Trees)lb; this.LodTree.CurrentView = this; }