Files
tianrunCRM/Assets/CoolapeFrame/Scripts/ui/public/CLPBackplate.cs

82 lines
1.8 KiB
C#
Raw Normal View History

2020-07-04 14:41:25 +08:00
/*
********************************************************************************
*Copyright(C),coolae.net
*Author: chenbin
*Version: 2.0
*Date: 2017-01-09
*Description:
*Others:
*History:
*********************************************************************************
*/
using UnityEngine;
using System.Collections;
//档板
namespace Coolape
{
public class CLPBackplate : CLPanelLua
{
public static CLPBackplate self;
// public UITexture textureBg;
// public Camera camera;
public CLPBackplate ()
{
self = this;
}
public override void show ()
{
base.show ();
}
public void procOtherPanel ()
{
if (CLPanelManager.panelRetainLayer.Count > 0) {
CLPanelBase[] ps = CLPanelManager.panelRetainLayer.ToArray ();
if (ps != null) {
for (int i = 0; i < ps.Length; i++) {
if (ps [i].isNeedBackplate && ps [i].isActive) {
_proc (ps [i]);
ps = null;
return;
}
}
hide ();
ps = null;
} else {
hide ();
}
} else {
hide ();
}
}
public void proc (CLPanelBase clpanel)
{
if (clpanel == null) {
procOtherPanel ();
return;
}
if (clpanel.isNeedBackplate) {
_proc (clpanel);
} else {
procOtherPanel ();
}
}
public void _proc (CLPanelBase clpanel)
{
setData (clpanel);
show ();
this.panel.depth = clpanel.panel.depth - 1;
Vector3 pos = transform.localPosition;
this.panel.renderQueue = UIPanel.RenderQueue.StartAt;
// 设置startingRenderQueue是为了可以在ui中使用粒子效果注意在粒子中要绑定CLUIParticle角本
this.panel.startingRenderQueue = CLPanelManager.Const_RenderQueue + this.panel.depth;
pos.z = -180;
transform.localPosition = pos;
}
}
}