示例#1
0
 public void DoAfterRelease()
 {
     // 编辑时是通过OnEnable\OnDisable触发Initialize Release的
     if (Application.isPlaying)
     {
         LODManager.GetInstance().RemoveLODItem(this);
         m_LODGroup = null;
     }
 }
示例#2
0
 protected void InitializeLOD()
 {
     m_LODItemActive = true;
     if (MaxDisplayLODIndex != Constants.NOTSET_LOD_INDEX)
     {
         m_LODGroup = transform.GetComponentInParent <LODGroup>();
         if (m_LODGroup)
         {
             LODManager.GetInstance().AddLODItem(this);
         }
     }
 }
示例#3
0
 public static LODManager GetInstance()
 {
     if (ms_Instance == null)
     {
         ms_Instance = FindObjectOfType <LODManager>();
         if (ms_Instance == null)
         {
             ms_Instance = new GameObject().AddComponent <LODManager>();
         }
     }
     return(ms_Instance);
 }
        protected void OnEnable()
        {
            if (LODGroup)
            {
                LODManager.GetInstance().AddLODItem(this);
            }

            m_LastLODIndex = Constants.NOTSET_LOD_INDEX;
            for (int iSwitch = 0; iSwitch < Switchs.Length; iSwitch++)
            {
                Switchs[iSwitch].SetActive(false);
            }
        }
 protected void OnDisable()
 {
     LODManager.GetInstance().RemoveLODItem(this);
 }