Files
tianrunCRM/Assets/CoolapeFrame/Scripts/ui/public/CLPBackplate.cs
2020-07-04 14:41:25 +08:00

82 lines
1.8 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
********************************************************************************
*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;
}
}
}