protected void OnCreate() { if (parent == null)//目标丢失 { return; } this.start = GameTimer.time; duration = host.config.EndTime; if (this.asset is GameObject) { this.gameObject = UnityEngine.Object.Instantiate(this.asset) as GameObject; EffectQuality effectQuality = this.gameObject.GetComponent <EffectQuality>(); if (effectQuality) { effectQuality.Show = true; } DestoryByTime component = this.gameObject.GetComponent <DestoryByTime>(); if (component != null) { duration = component.time; Object.DestroyImmediate(component); } } OnInit(); isdone = true; }
public void OnCreate(UnityEngine.Object asset) { this.gameObject = UnityEngine.Object.Instantiate(asset) as GameObject; DestoryByTime timeDesCompoment = gameObject.GetComponent <DestoryByTime>(); if (timeDesCompoment != null) { start_time = Time.realtimeSinceStartup; duration_time = timeDesCompoment.time; GameObject.DestroyImmediate(timeDesCompoment); } }
protected override void OnCreate() { this.gameObject = UnityEngine.Object.Instantiate(this.GetOwner().GetAsset()) as GameObject; DestoryByTime timeDesCompoment = gameObject.GetComponent <DestoryByTime>(); if (timeDesCompoment != null) { start_time = GameTimer.time; duration_time = timeDesCompoment.time; CClientCommon.DestroyImmediate(timeDesCompoment); } if (delayShow) { DelayShow(); } SetParticleScale(ParticleScale); isDone = true; }