void SetGameObject(GameObject go) { EffectGo = go; if (EffectGo && this != null) { EffectGo.transform.parent = this.transform; EffectGo.transform.localPosition = Vector3.zero; EffectGo.transform.localScale = Vector3.one; if (setrq) { reEnableSetRenderQueue(); } else { EffectDepth efd = EffectGo.GetComponent <EffectDepth>(); if (!efd) { efd = EffectGo.AddComponent <EffectDepth>(); } if (targetGb) { Canvas parentWidget = targetGb.GetComponent <Canvas>(); if (parentWidget) { efd.target = parentWidget; } } } } }
/// <summary> /// 设置深度 /// </summary> public void SetEffectDepth(EffectDepth depth) { if (depth == EffectDepth.Front) { Vector3 pos = transform.position; pos.z = -1.2f; transform.position = pos; } }
/// <summary> /// 设置深度 /// </summary> public void SetEffectDepth(EffectDepth depth) { m_depth = depth; }