コード例 #1
0
 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;
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: NdEffect.cs プロジェクト: 741645596/batgame
 /// <summary>
 /// 设置深度
 /// </summary>
 public void SetEffectDepth(EffectDepth depth)
 {
     if (depth == EffectDepth.Front)
     {
         Vector3 pos = transform.position;
         pos.z = -1.2f;
         transform.position = pos;
     }
 }
コード例 #3
0
ファイル: GameObjectAction.cs プロジェクト: 741645596/batgame
 /// <summary>
 /// 设置深度
 /// </summary>
 public void SetEffectDepth(EffectDepth depth)
 {
     m_depth = depth;
 }