void PlayGridEffect() { if ((mItemTex.enabled == true && mItemTex.mainTexture != null) || (mItemspr.enabled == true && mItemspr.spriteName != "Null")) { GameObject obj = GameObject.Instantiate(UIGridEffectPrefab) as GameObject; obj.transform.parent = this.transform.parent; obj.transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, -5); obj.transform.localScale = new Vector3(48, 48, 1); effect = obj.GetComponentInChildren <PeUIEffect.UIGridEffect>(); if (effect != null) { effect.e_OnEnd += EffectEnd; } } }
public void PlayGridEffect() { if (gridEffectPrefab == null) { return; } if (_effectGo != null) { Destroy(_effectGo); effect = null; } _effectGo = GameObject.Instantiate(gridEffectPrefab) as GameObject; _effectGo.transform.parent = this.transform.parent; _effectGo.transform.localPosition = new Vector3(transform.localPosition.x, transform.localPosition.y, -5); _effectGo.transform.localScale = new Vector3(48, 48, 1); effect = _effectGo.GetComponentInChildren <PeUIEffect.UIGridEffect>(); if (effect != null) { effect.e_OnEnd += EffectEnd; } }
void EffectEnd(PeUIEffect.UIEffect _effect) { effect = null; }