zoukankan      html  css  js  c++  java
  • NGUI Sprite 和 Label 改变Layer 或父物体后 未更新深度问题

    using UnityEngine;
    using System.Collections.Generic;
    
    /// <summary>
    /// Sprite is a textured element in the UI hierarchy.
    /// </summary>
    /// 
    public partial class UISprite : UIBasicSprite
    {
    public void OnInitNew()
    {
    OnInit();
    }
    }

    ///
    <summary> /// Auto-upgrade. /// </summary> protected override void OnInit () { Debug.Log("Chu SHiHua"); if (!mFillCenter) { mFillCenter = true; centerType = AdvancedType.Invisible; #if UNITY_EDITOR NGUITools.SetDirty(this); #endif } base.OnInit(); }
     public void OnInit2()
        {
            OnInit();
        }

    递归


    void
    WhileFindChild(Transform transform) { Transform temp = transform; Debug.Log(""+temp.name); if (transform.GetComponent<UISprite>()) { transform.GetComponent<UISprite>().OnInit2(); } if (transform.GetComponent<UILabel>()) { transform.GetComponent<UILabel>().OnInit2(); } if (temp.childCount > 0) { foreach (Transform item in temp) { UILabel label = item.GetComponent<UILabel>(); if (label) { label.OnInit2(); } UISprite sprite = item.GetComponent<UISprite>(); if (sprite) { sprite.OnInit2(); } temp = item; WhileFindChild(temp); } } }
  • 相关阅读:
    Numpy 里线性代数函数
    lateral view 使用方法
    Numpy 基础函数
    Numpy 基础操作
    pandas 基础操作记录学习
    pandas向左移动非空单元格
    供应商自动记账
    SAP Smartforms 参数配置
    SAP FPM 相关包 APB_FPM_CORE
    SAP BPC 清除CUBE 中的数据
  • 原文地址:https://www.cnblogs.com/123ing/p/4090104.html
Copyright © 2011-2022 走看看