private void Start() { this.GetEffectSettingsComponent(base.transform); this.goInstances = new List <GameObject>(); this.count = (int)(this.Duration / this.Interval); for (int i = 0; i < this.count; i++) { Quaternion rotation = new Quaternion(); GameObject item = Instantiate <GameObject>(this.GO, base.transform.position, rotation); item.transform.parent = base.transform; UpdateRankEffectSettings component = item.GetComponent <UpdateRankEffectSettings>(); component.Target = this.effectSettings.Target; component.IsHomingMove = this.effectSettings.IsHomingMove; component.MoveDistance = this.effectSettings.MoveDistance; component.MoveSpeed = this.effectSettings.MoveSpeed; component.CollisionEnter += (n, e) => this.effectSettings.OnCollisionHandler(e); component.ColliderRadius = this.effectSettings.ColliderRadius; component.EffectRadius = this.effectSettings.EffectRadius; component.EffectDeactivated += new EventHandler(this.effectSettings_EffectDeactivated); this.goInstances.Add(item); item.SetActive(false); } this.InvokeAll(); this.isInitialized = true; }
private void GetEffectSettingsComponent(Transform tr) { Transform parent = tr.parent; if (parent != null) { this.effectSettings = parent.GetComponentInChildren <UpdateRankEffectSettings>(); if (this.effectSettings == null) { this.GetEffectSettingsComponent(parent.transform); } } }