public calculateLayerDepthForChild ( float zIndexMin, float zIndexMax, |
||
zIndexMin | float | |
zIndexMax | float | |
child | Child. | |
zIndexMaxChild | float | Z index max child. |
Результат | float |
/// <summary> /// helper to translate zIndex to layerDepth. zIndexMax should be at least equal to the highest zIndex /// </summary> /// <returns>The depth.</returns> /// <param name="zIndexMax">Z index max.</param> public float calculateLayerDepth( float zIndexMin, float zIndexMax, CompositeItemVO compositeItem ) { if( compositeItem != null ) return compositeItem.calculateLayerDepthForChild( zIndexMin, zIndexMax, this ); return Mathf.map01( (float)zIndex, zIndexMin, zIndexMax ); }
/// <summary> /// helper to translate zIndex to layerDepth. zIndexMax should be at least equal to the highest zIndex /// </summary> /// <returns>The depth.</returns> /// <param name="zIndexMax">Z index max.</param> public float calculateLayerDepth(float zIndexMax, CompositeItemVO compositeItem) { if (compositeItem != null) { return(compositeItem.calculateLayerDepthForChild(zIndexMax, this)); } return((zIndexMax - (float)zIndex) / zIndexMax); }
/// <summary> /// helper to translate zIndex to layerDepth. zIndexMax should be at least equal to the highest zIndex /// </summary> /// <returns>The depth.</returns> /// <param name="zIndexMax">Z index max.</param> public float calculateLayerDepth(float zIndexMin, float zIndexMax, CompositeItemVO compositeItem) { if (compositeItem != null) { return(compositeItem.calculateLayerDepthForChild(zIndexMin, zIndexMax, this)); } return(Mathf.map01((float)zIndex, zIndexMin, zIndexMax)); }