public int CalcSortingOrder(bool bWithBasis = true)
 {
     if (bWithBasis && _ISOBasis != null && _ISOBasis.bActivated)
     {
         return(_ISOBasis.CalcSortingOrder());
     }
     return(IsometricSortingOrderUtility.IsometricSortingOrder(transform) + _iExternAdd);
 }
 public int CalcSortingOrder(bool bWithBasis = true)
 {
     if (bWithBasis && _ISOBasis != null && _ISOBasis.bActivated)
     {
         return(_ISOBasis.CalcSortingOrder());
     }
     return(IsometricSortingOrderUtility.IsometricSortingOrder(GetBounds().center));
 }
 public void Update_SortingOrder()
 {
     if (Iso2Ds != null)
     {
         int _so = IsometricSortingOrderUtility.IsometricSortingOrder(transform);
         foreach (var _iso2D in Iso2Ds)
         {
             _so = _iso2D.Update_SortingOrder(_so);
         }
     }
 }
        void update_SortingOrder(bool bJustDoIt = false)
        {
            if (IsoMap.IsNull)
            {
                return;
            }

            bool isLastCalc = false;

            if (!IsoMap.instance.bUseIsometricSorting && !Corrupted_LastSortingOrder())
            {
                Corrupt_LastSortingOrder();
                isLastCalc = true;
            }

            if (IsoMap.instance.bUseIsometricSorting)
            {
                int _iNewSortingOrder = IsometricSortingOrderUtility.IsometricSortingOrder(transform) + _iExternAdd;
                if (bJustDoIt || _iNewSortingOrder != iLastSortingOrder)
                {
                    iLastSortingOrder = _iNewSortingOrder;
                }
            }

            if (IsoMap.instance.bUseIsometricSorting)
            {
                for (int i = 0; i < DependentList.Count; ++i)
                {
                    DependentList[i].sortingOrder = iLastSortingOrder + i;
                }
            }
            else if (isLastCalc || bJustDoIt)
            {
                for (int i = 0; i < DependentList.Count; ++i)
                {
                    DependentList[i].sortingOrder = 0;
                }

                for (int i = 0; i < ParticleSystemRendererList.Count; ++i)
                {
                    ParticleSystemRendererList[i].sortingOrder = 0;
                }
            }

#if UNITY_EDITOR
            for (int i = 0; i < RegularColliderList.Count; ++i)
            {
                RegularColliderList[i].Update_SortingOrder();
            }
#endif
        }
        void update_particleSortingOrder(bool bJustDoIt = false)
        {
            Vector3 _rendererPosition;

            for (int i = 0; i < ParticleSystemRendererList.Count; ++i)
            {
                _rendererPosition = ParticleSystemRendererList[i].transform.position;
                if (IsoMap.instance.bUseIsometricSorting)
                {
                    if (bJustDoIt || _particleLastPositionList[i] != _rendererPosition)
                    {
                        _particleLastPositionList[i] = _rendererPosition;
                        ParticleSystemRendererList[i].sortingOrder = _iExternAdd + iParticleSortingAdd +
                                                                     IsometricSortingOrderUtility.IsometricSortingOrder(ParticleSystemRendererList[i].transform);
                    }
                }
            }
        }
Beispiel #6
0
 override public int SortingOrder_Adjustment()
 {
     return(IsometricSortingOrderUtility.IsometricSortingOrder(vJumpOffset));
 }
Beispiel #7
0
        //private void OnValidate()
        //{
        //    Update_SortingOrder();
        //}

        public int CalcSortingOrder()
        {
            return(IsometricSortingOrderUtility.IsometricSortingOrder(getSortingOrderBasis() + GetOffsetViaParentRC()));
        }