예제 #1
0
        public void InsertLOD()
        {
            int   insertIndex  = -1;
            float screenHeight = 0.1f;

            foreach (var lod in m_LODs)
            {
                if (m_Percentage > lod.RawScreenPercent)
                {
                    insertIndex  = lod.LODLevel;
                    screenHeight = lod.ScreenPercent;
                    break;
                }
            }

            LODAsset asset = new LODAsset();

            asset.screenRelativeHeight = Mathf.Max(0.1f, screenHeight - 0.1f);
            if (insertIndex < 0)
            {
                m_LODsProperty.Add(asset);
                insertIndex = m_LODs.Count;
            }
            else
            {
                m_LODsProperty.Insert(insertIndex, asset);
            }

            asset.screenRelativeHeight = m_Percentage;
            m_Callback?.Invoke();
        }
예제 #2
0
 private void OnEnable()
 {
     if (m_LODs == null)
     {
         m_LODs = new List <LODAsset>();
         for (int i = 0; i < m_NumberOfLODs; i++)
         {
             LODAsset oDAsset = new LODAsset();
             oDAsset.screenRelativeHeight = (m_NumberOfLODs - i) * 0.25f;
             m_LODs.Add(oDAsset);
         }
     }
 }
예제 #3
0
 private void OnEnable()
 {
     if (m_LODs == null)
     {
         m_LODs = new List <LODAsset>();
         for (int i = 0; i < m_NumberOfLODs; i++)
         {
             LODAsset oDAsset = new LODAsset();
             oDAsset.screenPercentage = (m_NumberOfLODs - i) * 0.25f;
             GameObject go = GameObject.Find("UnityChanLipSync_LOD" + (i + 1));
             oDAsset.Drop(go);
             m_LODs.Add(oDAsset);
         }
         UpdateBehavic();
         SelectedLOD = 0;
     }
 }