Esempio n. 1
0
        /// <summary>
        /// 将指定的<see cref="UILayer"/>移动到分组最高显示优先级。
        /// </summary>
        /// <param name="layer">图层</param>
        internal void BringToFront(UILayer layer)
        {
            if (layer.Group != this)
            {
                throw new ArgumentException("layer");
            }

            if (mLayers.Count <= 1)
            {
                return;
            }

            mLayers.Remove(layer);
            layer.Order = mLayers.Last().Order + 1;
            mLayers.Add(layer);
        }
Esempio n. 2
0
        /// <summary>
        /// 当<see cref="UILayer"/>创建完毕后调用此方法。
        /// </summary>
        /// <param name="layer"></param>
        protected override void OnAddUILayer(UILayer layer)
        {
            var canvasLayer = (RectTransformLayer)layer;

            canvasLayer.SetParent(GroupTransform);
        }
Esempio n. 3
0
 /// <summary>
 /// 当<see cref="UILayer"/>创建完毕后调用此方法。
 /// </summary>
 /// <param name="layer"></param>
 protected virtual void OnAddUILayer(UILayer layer)
 {
 }
Esempio n. 4
0
 /// <summary>
 /// 移除分组中指定的<see cref="UILayer"/>。
 /// </summary>
 /// <param name="layer"></param>
 internal void Remove(UILayer layer)
 {
     mLayers.Remove(layer);
 }